update
This commit is contained in:
parent
674a419ad9
commit
7fdd94f375
@ -16,6 +16,7 @@ namespace app\adminapi\lists\bid;
|
||||
|
||||
|
||||
use app\adminapi\lists\BaseAdminDataLists;
|
||||
use app\common\lists\ListsExcelInterface;
|
||||
use app\common\model\auth\Admin;
|
||||
use app\common\model\bid\BidBiddingDecision;
|
||||
use app\common\model\bid\BidBuyBiddingDocument;
|
||||
@ -29,7 +30,7 @@ use app\common\model\project\Project;
|
||||
* Class BidBuyBiddingDocumentLists
|
||||
* @package app\adminapi\listsbid
|
||||
*/
|
||||
class BidBuyBiddingDocumentLists extends BaseAdminDataLists implements ListsSearchInterface
|
||||
class BidBuyBiddingDocumentLists extends BaseAdminDataLists implements ListsSearchInterface,ListsExcelInterface
|
||||
{
|
||||
|
||||
|
||||
@ -74,7 +75,7 @@ class BidBuyBiddingDocumentLists extends BaseAdminDataLists implements ListsSear
|
||||
$project_ids = Project::where('custom_id',$params['custom_id'])->column('id');
|
||||
$where[] = ['project_id','in',$project_ids];
|
||||
}
|
||||
return BidBuyBiddingDocument::field('id,project_id,bid_decision_id,code,bid_document_no,invite_tenders_company_name,bid_company_name,buyer,amount,buy_date,bid_address')
|
||||
return BidBuyBiddingDocument::field('id,project_id,bid_decision_id,bid_document_no,invite_tenders_company_name,bid_company_name,buyer,amount,buy_date,bid_address')
|
||||
->where($this->searchWhere)->where($where)
|
||||
->limit($this->limitOffset, $this->limitLength)
|
||||
->order(['id' => 'desc'])
|
||||
@ -124,5 +125,35 @@ class BidBuyBiddingDocumentLists extends BaseAdminDataLists implements ListsSear
|
||||
}
|
||||
return BidBuyBiddingDocument::where($this->searchWhere)->where($where)->count();
|
||||
}
|
||||
|
||||
|
||||
public function setFileName(): string
|
||||
{
|
||||
return '购买标书列表';
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 导出字段
|
||||
* @return string[]
|
||||
* @author 段誉
|
||||
* @date 2022/11/24 16:17
|
||||
*/
|
||||
public function setExcelFields(): array
|
||||
{
|
||||
return [
|
||||
'id' => '投标决策id',
|
||||
'bid_decision_code' => '投标决策编码',
|
||||
'custom_name' => '客户名称',
|
||||
'project_name' => '项目名称',
|
||||
'bid_document_no' => '标书编号',
|
||||
'invite_tenders_company_name' => '招标公司名称',
|
||||
'bid_company_name' => '投标公司名称',
|
||||
'buyer' => '购买人员',
|
||||
'amount' => '购买标书金额',
|
||||
'bidding_project_fund_source' => '招标项目资金来源',
|
||||
'bidding_time' => '投标时间',
|
||||
'buy_date' => '购买标书时间',
|
||||
'bid_type' => '招标方式',
|
||||
'bid_address' => '投标地址',
|
||||
];
|
||||
}
|
||||
}
|
@ -45,10 +45,9 @@ class BidBuyBiddingDocumentLogic extends BaseLogic
|
||||
Db::startTrans();
|
||||
try {
|
||||
BidBuyBiddingDocument::create([
|
||||
'code' => data_unique_code('购买标书'),
|
||||
'project_id' => $params['project_id'],
|
||||
'bid_decision_id' => $params['bid_decision_id'],
|
||||
'bid_document_no' => $params['bid_document_no'],
|
||||
'bid_document_no' => data_unique_code('购买标书'),
|
||||
'invite_tenders_company_name' => $params['invite_tenders_company_name'],
|
||||
'bid_company_name' => $params['bid_company_name'],
|
||||
'buyer' => $params['buyer'] ?? 0,
|
||||
@ -80,7 +79,6 @@ class BidBuyBiddingDocumentLogic extends BaseLogic
|
||||
BidBuyBiddingDocument::where('id', $params['id'])->update([
|
||||
'project_id' => $params['project_id'],
|
||||
'bid_decision_id' => $params['bid_decision_id'],
|
||||
'bid_document_no' => $params['bid_document_no'],
|
||||
'invite_tenders_company_name' => $params['invite_tenders_company_name'],
|
||||
'bid_company_name' => $params['bid_company_name'],
|
||||
'buyer' => $params['buyer'] ?? 0,
|
||||
@ -121,7 +119,7 @@ class BidBuyBiddingDocumentLogic extends BaseLogic
|
||||
*/
|
||||
public static function detail($params): array
|
||||
{
|
||||
$data = BidBuyBiddingDocument::field('id,project_id,bid_decision_id,code,bid_document_no,invite_tenders_company_name,bid_company_name,buyer,amount,buy_date,bid_address')->findOrEmpty($params['id']);
|
||||
$data = BidBuyBiddingDocument::field('id,project_id,bid_decision_id,bid_document_no,invite_tenders_company_name,bid_company_name,buyer,amount,buy_date,bid_address')->findOrEmpty($params['id']);
|
||||
$project = Project::field('custom_id,name,project_code')->where('id',$data['project_id'])->findOrEmpty();
|
||||
$custom = Custom::field('name')->where('id',$project['custom_id'])->findOrEmpty();
|
||||
$bid_decision = BidBiddingDecision::field('code,bidding_project_fund_source,bidding_time,bid_type,is_margin,margin_amount,bid_opening_date,margin_amount_return_date,bid_project_overview,project_desc,annex')->where('id',$data['bid_decision_id'])->findOrEmpty();
|
||||
|
Loading…
x
Reference in New Issue
Block a user