GameLocationModel.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. namespace App\Models\Syj;
  3. use Illuminate\Database\Eloquent\Model;
  4. /**
  5. * App\Models\Syj\GameLocationModel
  6. *
  7. * @property int $id
  8. * @property string $uuid
  9. * @property string $openid
  10. * @property string $lng 经度
  11. * @property string $lat 纬度
  12. * @property int $parent_id 父级ID
  13. * @property \Illuminate\Support\Carbon $created_at 创建时间
  14. * @property \Illuminate\Support\Carbon $updated_at 修改时间
  15. * @property-read \App\Models\Syj\UserModel $user
  16. * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Syj\GameLocationModel newModelQuery()
  17. * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Syj\GameLocationModel newQuery()
  18. * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Syj\GameLocationModel query()
  19. * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Syj\GameLocationModel whereCreatedAt($value)
  20. * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Syj\GameLocationModel whereId($value)
  21. * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Syj\GameLocationModel whereLat($value)
  22. * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Syj\GameLocationModel whereLng($value)
  23. * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Syj\GameLocationModel whereOpenid($value)
  24. * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Syj\GameLocationModel whereParentId($value)
  25. * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Syj\GameLocationModel whereUpdatedAt($value)
  26. * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Syj\GameLocationModel whereUuid($value)
  27. * @mixin \Eloquent
  28. */
  29. class GameLocationModel extends Model
  30. {
  31. //
  32. protected $table = 'syj_game_locations';
  33. protected $dateFormat = 'U';
  34. protected $fillable = ['openid', 'uuid', 'lng', 'lat', 'parent_id'];
  35. public function user()
  36. {
  37. return $this->belongsTo(UserModel::class, 'openid', 'openid')->select('nickname', 'avatar', 'sex');
  38. }
  39. }