You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
1.1 KiB
44 lines
1.1 KiB
<?php
|
|
|
|
namespace app\fire\model;
|
|
|
|
use app\base\model\user\User;
|
|
use app\base\model\user\UserInfo;
|
|
use app\discount\model\DiscountCouponMy;
|
|
use app\distribution\model\DistributionCommissionMy;
|
|
use think\model\concern\SoftDelete;
|
|
|
|
class FireExpert extends Base
|
|
{
|
|
use SoftDelete;
|
|
|
|
protected $type = [
|
|
'certificate_img' => 'serialize',
|
|
];
|
|
|
|
public function userHead()
|
|
{
|
|
return $this->hasOne(UserInfo::class,'user_id','user_id')->bind(['head_img']);
|
|
}
|
|
|
|
public function userPhone()
|
|
{
|
|
return $this->hasOne(User::class,'id','user_id')->bind(['user_mobile_phone'=>'mobile_phone']);
|
|
}
|
|
|
|
public function expertCategory()
|
|
{
|
|
return $this->hasOne('FireExpertCategory','id','category_id')->bind(['category_name'=>'name']);
|
|
}
|
|
|
|
public function getStatusTextAttr($value,$data)
|
|
{
|
|
$status = [1=>'待审核',2=>'已通过',3=>'已拒绝'];
|
|
return $status[$data['status']];
|
|
}
|
|
|
|
public function expertCommission()
|
|
{
|
|
return $this->hasOne(DistributionCommissionMy::class,'user_id','user_id')->bind(['commission','total_commission']);
|
|
}
|
|
} |