CompanyInfoModel.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. namespace App\Models;
  3. use App\Models\BaseModel;
  4. /**
  5. * @description 挖掘线索
  6. * @author system;
  7. * @version 1.0
  8. * @date 2018-11-19 08:23:08
  9. *
  10. */
  11. class CompanyInfoModel extends BaseModel
  12. {
  13. /**
  14. * 数据表名
  15. *
  16. * @var string
  17. *
  18. */
  19. protected $table = 'company_info';
  20. /**
  21. * 主键
  22. */
  23. protected $primaryKey = 'id';
  24. //分页
  25. protected $perPage = PAGE_NUMS;
  26. /**
  27. * 可以被集体附值的表的字段
  28. *
  29. * @var string
  30. */
  31. protected $fillable = [
  32. 'companyName',
  33. 'regNo',
  34. 'orgNo',
  35. 'legalPerson',
  36. 'openStatus',
  37. 'startDate',
  38. 'openTime',
  39. 'annualDate',
  40. 'regCapital',
  41. 'entType',
  42. 'industry',
  43. 'district',
  44. 'authority',
  45. 'regAddr',
  46. 'scope',
  47. 'website'
  48. ];
  49. public function isThread(){
  50. $ower_id = \Auth::guard('admin')->user()->id;
  51. return UserThreadsModel::where('ower_id',$ower_id)->where('company_id',$this->id)->count();
  52. }
  53. }