update
This commit is contained in:
parent
4b20d04be7
commit
af97d76141
@ -22,8 +22,6 @@ use app\common\model\bid\BidDocumentExamination;
|
|||||||
use app\common\model\bid\BidResult;
|
use app\common\model\bid\BidResult;
|
||||||
use app\common\model\custom\Custom;
|
use app\common\model\custom\Custom;
|
||||||
use app\common\logic\BaseLogic;
|
use app\common\logic\BaseLogic;
|
||||||
use app\common\model\dept\Dept;
|
|
||||||
use app\common\model\dept\Orgs;
|
|
||||||
use app\common\model\project\Project;
|
use app\common\model\project\Project;
|
||||||
use think\facade\Db;
|
use think\facade\Db;
|
||||||
|
|
||||||
@ -50,8 +48,6 @@ class BidResultLogic extends BaseLogic
|
|||||||
Db::startTrans();
|
Db::startTrans();
|
||||||
try {
|
try {
|
||||||
BidResult::create([
|
BidResult::create([
|
||||||
'org_id' => $params['org_id'],
|
|
||||||
'dept_id' => $params['dept_id'],
|
|
||||||
'bid_document_examination_id' => $params['bid_document_examination_id'],
|
'bid_document_examination_id' => $params['bid_document_examination_id'],
|
||||||
'project_id' => $bid_document_examination['project_id'],
|
'project_id' => $bid_document_examination['project_id'],
|
||||||
'is_successful' => $params['is_successful'],
|
'is_successful' => $params['is_successful'],
|
||||||
@ -84,8 +80,6 @@ class BidResultLogic extends BaseLogic
|
|||||||
Db::startTrans();
|
Db::startTrans();
|
||||||
try {
|
try {
|
||||||
BidResult::where('id', $params['id'])->update([
|
BidResult::where('id', $params['id'])->update([
|
||||||
'org_id' => $params['org_id'],
|
|
||||||
'dept_id' => $params['dept_id'],
|
|
||||||
'bid_document_examination_id' => $params['bid_document_examination_id'],
|
'bid_document_examination_id' => $params['bid_document_examination_id'],
|
||||||
'is_successful' => $params['is_successful'],
|
'is_successful' => $params['is_successful'],
|
||||||
'bidder_company' => $params['bidder_company'],
|
'bidder_company' => $params['bidder_company'],
|
||||||
@ -127,17 +121,13 @@ class BidResultLogic extends BaseLogic
|
|||||||
*/
|
*/
|
||||||
public static function detail($params): array
|
public static function detail($params): array
|
||||||
{
|
{
|
||||||
$data = BidResult::field('id,org_id,dept_id,bid_document_examination_id,project_id,is_successful,bidder_company,bidder_amount,bid_summary,annex,add_user,update_user,create_time,update_time')->findOrEmpty($params['id']);
|
$data = BidResult::field('id,bid_document_examination_id,project_id,is_successful,bidder_company,bidder_amount,bid_summary,annex,add_user,update_user,create_time,update_time')->findOrEmpty($params['id']);
|
||||||
$org = Orgs::field('name')->where('id',$data['org_id'])->findOrEmpty();
|
|
||||||
$dept = Dept::field('name')->where('id',$data['dept_id'])->findOrEmpty();
|
|
||||||
$project = Project::field('name,project_code,custom_id')->where('id',$data['project_id'])->findOrEmpty();
|
$project = Project::field('name,project_code,custom_id')->where('id',$data['project_id'])->findOrEmpty();
|
||||||
$custom = Custom::field('name')->where('id',$project['custom_id'])->findOrEmpty();
|
$custom = Custom::field('name')->where('id',$project['custom_id'])->findOrEmpty();
|
||||||
$bid_document_examination = BidDocumentExamination::field('code,buy_bidding_document_id')->where('id',$data['bid_document_examination_id'])->findOrEmpty();
|
$bid_document_examination = BidDocumentExamination::field('code,buy_bidding_document_id')->where('id',$data['bid_document_examination_id'])->findOrEmpty();
|
||||||
$buy_bidding_document = BidBuyBiddingDocument::field('bid_decision_id')->where('id',$bid_document_examination['buy_bidding_document_id'])->findOrEmpty();
|
$buy_bidding_document = BidBuyBiddingDocument::field('bid_decision_id')->where('id',$bid_document_examination['buy_bidding_document_id'])->findOrEmpty();
|
||||||
$bid_decision = BidBiddingDecision::field('bidding_time,bid_opening_date')->where('id',$buy_bidding_document['bid_decision_id'])->findOrEmpty();
|
$bid_decision = BidBiddingDecision::field('bidding_time,bid_opening_date')->where('id',$buy_bidding_document['bid_decision_id'])->findOrEmpty();
|
||||||
$admin = Admin::where('id','in',[$data['add_user'],$data['update_user']])->column('name','id');
|
$admin = Admin::where('id','in',[$data['add_user'],$data['update_user']])->column('name','id');
|
||||||
$data['org_name'] = $org['name'];
|
|
||||||
$data['dept_name'] = $dept['name'];
|
|
||||||
$data['project_name'] = $project['name'];
|
$data['project_name'] = $project['name'];
|
||||||
$data['project_code'] = $project['project_code'];
|
$data['project_code'] = $project['project_code'];
|
||||||
$data['custom_name'] = $custom['name'];
|
$data['custom_name'] = $custom['name'];
|
||||||
|
@ -16,8 +16,6 @@ namespace app\adminapi\validate\bid;
|
|||||||
|
|
||||||
|
|
||||||
use app\common\model\bid\BidDocumentExamination;
|
use app\common\model\bid\BidDocumentExamination;
|
||||||
use app\common\model\dept\Dept;
|
|
||||||
use app\common\model\dept\Orgs;
|
|
||||||
use app\common\validate\BaseValidate;
|
use app\common\validate\BaseValidate;
|
||||||
|
|
||||||
|
|
||||||
@ -35,8 +33,6 @@ class BidResultValidate extends BaseValidate
|
|||||||
*/
|
*/
|
||||||
protected $rule = [
|
protected $rule = [
|
||||||
'id' => 'require',
|
'id' => 'require',
|
||||||
'org_id' => 'require|checkOrg',
|
|
||||||
'dept_id' => 'require|checkDept',
|
|
||||||
'bid_document_examination_id'=> 'require|checkBidDocumentExamination',
|
'bid_document_examination_id'=> 'require|checkBidDocumentExamination',
|
||||||
'is_successful' => 'require|in:0,1',
|
'is_successful' => 'require|in:0,1',
|
||||||
'bidder_company' => 'require',
|
'bidder_company' => 'require',
|
||||||
@ -46,8 +42,6 @@ class BidResultValidate extends BaseValidate
|
|||||||
|
|
||||||
protected $message = [
|
protected $message = [
|
||||||
'id.require' => '缺少必要参数',
|
'id.require' => '缺少必要参数',
|
||||||
'org_id.require' => '请选择组织',
|
|
||||||
'dept_id.require' => '请选择部门',
|
|
||||||
'bid_document_examination_id.require'=> '请选择投标编号',
|
'bid_document_examination_id.require'=> '请选择投标编号',
|
||||||
'is_successful.require' => '请选择是否中标',
|
'is_successful.require' => '请选择是否中标',
|
||||||
'is_successful.in' => '是否中标选项无效',
|
'is_successful.in' => '是否中标选项无效',
|
||||||
@ -103,27 +97,6 @@ class BidResultValidate extends BaseValidate
|
|||||||
return $this->only(['id']);
|
return $this->only(['id']);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function checkOrg($value): bool|string
|
|
||||||
{
|
|
||||||
$org = Orgs::where('id',$value)->findOrEmpty();
|
|
||||||
if($org->isEmpty()){
|
|
||||||
return '组织不存在';
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function checkDept($value,$rule,$data): bool|string
|
|
||||||
{
|
|
||||||
$dept = Dept::where('id',$value)->findOrEmpty();
|
|
||||||
if($dept->isEmpty()){
|
|
||||||
return '部门不存在';
|
|
||||||
}
|
|
||||||
if($dept['org_id'] != $data['org_id']){
|
|
||||||
return '部门无效';
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function checkBidDocumentExamination($value): bool|string
|
public function checkBidDocumentExamination($value): bool|string
|
||||||
{
|
{
|
||||||
$data = BidDocumentExamination::where('id',$value)->findOrEmpty();
|
$data = BidDocumentExamination::where('id',$value)->findOrEmpty();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user