ManagerList.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * Name: 芸众商城系统
  5. * Author: 广州市芸众信息科技有限公司
  6. * Profile: 广州市芸众信息科技有限公司位于国际商贸中心的广州,专注于移动电子商务生态系统打造,拥有芸众社交电商系统、区块链数字资产管理系统、供应链管理系统、电子合同等产品/服务。官网 :www.yunzmall.com www.yunzshop.com
  7. * Date: 2021/9/22
  8. * Time: 13:37
  9. */
  10. namespace business\common\models;
  11. use app\common\models\BaseModel;
  12. use app\common\models\Member;
  13. use business\common\services\SettingService;
  14. use Illuminate\Database\Eloquent\Builder;
  15. use Illuminate\Database\Eloquent\SoftDeletes;
  16. class ManagerList extends BaseModel
  17. {
  18. use SoftDeletes;
  19. public $table = 'yz_business_manager_list';
  20. public $timestamps = true;
  21. protected $guarded = [];
  22. protected $appends = [];
  23. protected $casts = [];
  24. public function business($business_id = 0)
  25. {
  26. $business_id = $business_id ?: SettingService::getBusinessId();
  27. return self::uniacid()->where('business_id', $business_id);
  28. }
  29. public function hasOneMember()
  30. {
  31. return $this->hasOne(Member::class, 'uid', 'uid');
  32. }
  33. public function hasOneStaff()
  34. {
  35. return $this->hasOne(Staff::class, 'uid', 'uid');
  36. }
  37. public function hasOneBusiness()
  38. {
  39. return $this->hasOne(Business::class, 'id', 'business_id');
  40. }
  41. }