合同列表更新
This commit is contained in:
parent
0ac2c151d4
commit
367b201d24
@ -18,7 +18,7 @@ namespace app\adminapi\lists\contract;
|
||||
use app\adminapi\lists\BaseAdminDataLists;
|
||||
use app\common\model\contract\Contract;
|
||||
use app\common\lists\ListsSearchInterface;
|
||||
|
||||
use think\facade\Db;
|
||||
|
||||
/**
|
||||
* Contract列表
|
||||
@ -56,10 +56,16 @@ class ContractLists extends BaseAdminDataLists implements ListsSearchInterface
|
||||
public function lists(): array
|
||||
{
|
||||
return Contract::where($this->searchWhere)->with(['companyName','partyA','contractType'])
|
||||
->field(['id', 'company_id', 'contract_type', 'contract_no', 'status', 'party_a', 'party_b', 'area_manager'])
|
||||
// ->field(['id', 'company_id', 'contract_type', 'contract_no', 'status', 'party_a', 'party_b', 'area_manager'])
|
||||
->limit($this->limitOffset, $this->limitLength)
|
||||
->order(['id' => 'desc'])
|
||||
->select()
|
||||
->select()->each(function ($item, $key) {
|
||||
if($item->type==1){
|
||||
$item->party_b_name=Db::name('company')->where('id',$item->party_b)->value('company_name');
|
||||
}else{
|
||||
$item->party_b_name=Db::name('admin')->where('id',$item->party_b)->value('name');
|
||||
}
|
||||
})
|
||||
->toArray();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user