更新细节
This commit is contained in:
parent
c721065af2
commit
1614bb084a
@ -56,7 +56,7 @@ class ContractLists extends BaseAdminDataLists implements ListsSearchInterface
|
|||||||
{
|
{
|
||||||
return Db::name('Contract')->alias('c')
|
return Db::name('Contract')->alias('c')
|
||||||
->where($this->searchWhere)
|
->where($this->searchWhere)
|
||||||
->leftJoin('bid_buy_bidding_document bbbd','c.id = c.buy_bidding_document_id')
|
->leftJoin('bid_buy_bidding_document bbbd','bbbd.id = c.buy_bidding_document_id')
|
||||||
->leftJoin('project p','p.id = bbbd.project_id')
|
->leftJoin('project p','p.id = bbbd.project_id')
|
||||||
->leftJoin('custom ct','ct.id = c.customer_id')
|
->leftJoin('custom ct','ct.id = c.customer_id')
|
||||||
->field('c.*, bbbd.project_id, p.name as project_name, ct.name as customer_name')
|
->field('c.*, bbbd.project_id, p.name as project_name, ct.name as customer_name')
|
||||||
|
@ -17,6 +17,8 @@ namespace app\adminapi\logic\bid;
|
|||||||
|
|
||||||
use app\common\model\bid\BidSecurityRefund;
|
use app\common\model\bid\BidSecurityRefund;
|
||||||
use app\common\logic\BaseLogic;
|
use app\common\logic\BaseLogic;
|
||||||
|
use app\common\model\project\Project;
|
||||||
|
use app\common\model\custom\Custom;
|
||||||
use think\facade\Db;
|
use think\facade\Db;
|
||||||
|
|
||||||
|
|
||||||
|
@ -17,6 +17,8 @@ namespace app\adminapi\logic\contract;
|
|||||||
|
|
||||||
use app\common\model\contract\Contract;
|
use app\common\model\contract\Contract;
|
||||||
use app\common\logic\BaseLogic;
|
use app\common\logic\BaseLogic;
|
||||||
|
use app\common\model\project\Project;
|
||||||
|
use app\common\model\custom\Custom;
|
||||||
use think\facade\Db;
|
use think\facade\Db;
|
||||||
|
|
||||||
|
|
||||||
@ -156,8 +158,15 @@ class ContractLogic extends BaseLogic
|
|||||||
public static function detail($params): array
|
public static function detail($params): array
|
||||||
{
|
{
|
||||||
$contract = Contract::findOrEmpty($params['id']);
|
$contract = Contract::findOrEmpty($params['id']);
|
||||||
$contract->custom;
|
|
||||||
$contract->document;
|
$contract->document;
|
||||||
|
$contract->project = null;
|
||||||
|
$contract->custom = null;
|
||||||
|
if (!empty($contract->document->project_id)) {
|
||||||
|
$contract->project = Project::findOrEmpty($contract->document->project_id);
|
||||||
|
}
|
||||||
|
if (!empty($contract->project->custom_id)) {
|
||||||
|
$contract->custom = Custom::findOrEmpty($contract->project->custom_id);
|
||||||
|
}
|
||||||
return $contract->toArray();
|
return $contract->toArray();
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user