Shop.php 948 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: Administrator
  5. * Date: 2019-04-28
  6. * Time: 15:30
  7. */
  8. namespace App;
  9. use Illuminate\Database\Eloquent\Model;
  10. use Illuminate\Database\Eloquent\SoftDeletes;
  11. class Shop extends Model
  12. {
  13. use SoftDeletes;
  14. protected $primaryKey = 'shop_id';
  15. public $table = 'shop';
  16. /**
  17. * The attributes that are mass assignable.
  18. *
  19. * @var array
  20. */
  21. protected $fillable = ['shop_name','shop_short_name','mobile','address','province_id','province_name','city_id','city_name','contact_mobile','contact_name','shop_desc','status','logo_img','license_img','food_trans_license','other_license','proportion','verify_type','star'];
  22. /**
  23. * The attributes excluded from the model's JSON form.
  24. *
  25. * @var array
  26. */
  27. protected $hidden = [];
  28. //关联账户
  29. public function account()
  30. {
  31. return $this->hasOne('App\ShopAccount', 'shop_id', 'shop_id');
  32. }
  33. }