更新
This commit is contained in:
parent
b51340de51
commit
7f985283ad
@ -16,6 +16,7 @@ namespace app\adminapi\lists\user;
|
||||
use app\adminapi\lists\BaseAdminDataLists;
|
||||
use app\common\enum\user\UserTerminalEnum;
|
||||
use app\common\lists\ListsExcelInterface;
|
||||
use app\common\model\contract\Contract;
|
||||
use app\common\model\user\User;
|
||||
use think\facade\Db;
|
||||
|
||||
@ -68,7 +69,11 @@ class UserLists extends BaseAdminDataLists implements ListsExcelInterface
|
||||
->limit($this->limitOffset, $this->limitLength)
|
||||
->field($field)
|
||||
->order('id desc')
|
||||
->select()->toArray();
|
||||
->select()->each(function($item, $key){
|
||||
$find= Contract::where('type',2)->where('party_b',$item['id'])->field('id,party_a,party_b,check_status')->find();
|
||||
$item['contract'] = $find;
|
||||
})
|
||||
->toArray();
|
||||
|
||||
foreach ($lists as &$item) {
|
||||
$item['channel'] = UserTerminalEnum::getTermInalDesc($item['channel']);
|
||||
|
@ -22,6 +22,7 @@ use app\common\model\BaseModel;
|
||||
use app\common\service\FileService;
|
||||
use think\model\concern\SoftDelete;
|
||||
use app\common\model\Company;
|
||||
use app\common\model\contract\Contract;
|
||||
use think\facade\Db;
|
||||
/**
|
||||
* 用户模型
|
||||
@ -183,7 +184,6 @@ class User extends BaseModel
|
||||
{
|
||||
return $this->hasOne(Company::class, 'id', 'company_id')->field(['id','company_name','admin_id']);
|
||||
}
|
||||
|
||||
public function getCityNameAttr($value)
|
||||
{
|
||||
return Db::name('geo_city')->where(['city_code' => $this->city])->value('city_name');
|
||||
|
Loading…
x
Reference in New Issue
Block a user