1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- <?php
- namespace App\Models;
- use App\Models\BaseModel;
- /**
- * @description 挖掘线索
- * @author system;
- * @version 1.0
- * @date 2018-11-19 08:23:08
- *
- */
- class CompanyInfoModel extends BaseModel
- {
- /**
- * 数据表名
- *
- * @var string
- *
- */
- protected $table = 'company_info';
- /**
- * 主键
- */
- protected $primaryKey = 'id';
- //分页
- protected $perPage = PAGE_NUMS;
- /**
- * 可以被集体附值的表的字段
- *
- * @var string
- */
- protected $fillable = [
- 'companyName',
- 'regNo',
- 'orgNo',
- 'legalPerson',
- 'openStatus',
- 'startDate',
- 'openTime',
- 'annualDate',
- 'regCapital',
- 'entType',
- 'industry',
- 'district',
- 'authority',
- 'regAddr',
- 'scope',
- 'website'
- ];
- public function isThread(){
- $ower_id = \Auth::guard('admin')->user()->id;
- return UserThreadsModel::where('ower_id',$ower_id)->where('company_id',$this->id)->count();
- }
- public function contacts(){
- return $this->hasMany('App\Models\CompanyContactsModel','company_id');
- }
- }
|