This commit is contained in:
weiz 2024-04-12 15:46:48 +08:00
parent e17852ad45
commit 5d9e02eae7
4 changed files with 18 additions and 1 deletions

View File

@ -18,6 +18,7 @@
use app\adminapi\lists\BaseAdminDataLists; use app\adminapi\lists\BaseAdminDataLists;
use app\common\lists\ListsSearchInterface; use app\common\lists\ListsSearchInterface;
use app\common\model\marketing\MarketingBidResultDetail; use app\common\model\marketing\MarketingBidResultDetail;
use app\common\model\marketing\MarketingCompetitor;
/** /**
@ -58,6 +59,8 @@
->limit($this->limitOffset, $this->limitLength) ->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc']) ->order(['id' => 'desc'])
->select()->each(function ($data) { ->select()->each(function ($data) {
$company = MarketingCompetitor::field('company_name')->where('id', $data['company'])->findOrEmpty();
$data['company_name'] = $company['company_name'];
$data['result_text'] = $data->result_text; $data['result_text'] = $data->result_text;
}) })
->toArray(); ->toArray();

View File

@ -17,6 +17,7 @@
use app\common\logic\BaseLogic; use app\common\logic\BaseLogic;
use app\common\model\marketing\MarketingBidResultDetail; use app\common\model\marketing\MarketingBidResultDetail;
use app\common\model\marketing\MarketingCompetitor;
use think\facade\Db; use think\facade\Db;
@ -116,6 +117,8 @@
public static function detail($params): array public static function detail($params): array
{ {
$data = MarketingBidResultDetail::withoutField('create_time,update_time,delete_time')->findOrEmpty($params['id']); $data = MarketingBidResultDetail::withoutField('create_time,update_time,delete_time')->findOrEmpty($params['id']);
$company = MarketingCompetitor::field('company_name')->where('id', $data['company'])->findOrEmpty();
$data['company_name'] = $company['company_name'];
$data['result_text'] = $data->result_text; $data['result_text'] = $data->result_text;
return $data->toArray(); return $data->toArray();
} }

View File

@ -17,6 +17,7 @@
use app\common\model\marketing\MarketingBidResult; use app\common\model\marketing\MarketingBidResult;
use app\common\model\marketing\MarketingBidResultDetail; use app\common\model\marketing\MarketingBidResultDetail;
use app\common\model\marketing\MarketingCompetitor;
use app\common\validate\BaseValidate; use app\common\validate\BaseValidate;
@ -35,7 +36,7 @@
protected $rule = [ protected $rule = [
'id' => 'require|checkData', 'id' => 'require|checkData',
'bid_result_id' => 'require|checkBidResult', 'bid_result_id' => 'require|checkBidResult',
'company' => 'require', 'company' => 'require|checkCompany',
'quotation_one' => 'float|egt:0', 'quotation_one' => 'float|egt:0',
'quotation_two' => 'float|egt:0', 'quotation_two' => 'float|egt:0',
'quotation_three' => 'float|egt:0', 'quotation_three' => 'float|egt:0',
@ -120,4 +121,10 @@
$data = MarketingBidResult::where('id', $value)->findOrEmpty(); $data = MarketingBidResult::where('id', $value)->findOrEmpty();
return $data->isEmpty() ? '投标信息数据不存在' : true; return $data->isEmpty() ? '投标信息数据不存在' : true;
} }
public function checkCompany($value): bool|string
{
$data = MarketingCompetitor::where('id', $value)->findOrEmpty();
return $data->isEmpty() ? '投标单位数据不存在' : true;
}
} }

View File

@ -19,6 +19,7 @@
use app\common\model\marketing\MarketingBidInfo; use app\common\model\marketing\MarketingBidInfo;
use app\common\model\marketing\MarketingBidResult; use app\common\model\marketing\MarketingBidResult;
use app\common\model\marketing\MarketingBidResultDetail; use app\common\model\marketing\MarketingBidResultDetail;
use app\common\model\marketing\MarketingCompetitor;
use app\common\validate\BaseValidate; use app\common\validate\BaseValidate;
@ -145,6 +146,9 @@
} }
if (empty($v['company'])) { if (empty($v['company'])) {
return '参标单位列表第' . ($k + 1) . '行投标单位为空'; return '参标单位列表第' . ($k + 1) . '行投标单位为空';
} else {
$company = MarketingCompetitor::where('id', $v['company'])->findOrEmpty();
if ($company->isEmpty()) return '参标单位列表第' . ($k + 1) . '行投标单位信息不存在';
} }
} }
return true; return true;