140 lines
5.3 KiB
PHP
140 lines
5.3 KiB
PHP
<?php
|
||
// +----------------------------------------------------------------------
|
||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||
// +----------------------------------------------------------------------
|
||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||
// | 开源版本可自由商用,可去除界面版权logo
|
||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||
// | 访问官网:https://www.likeadmin.cn
|
||
// | likeadmin团队 版权所有 拥有最终解释权
|
||
// +----------------------------------------------------------------------
|
||
// | author: likeadminTeam
|
||
// +----------------------------------------------------------------------
|
||
|
||
namespace app\adminapi\logic\bid;
|
||
|
||
|
||
use app\common\model\bid\BidDocumentExamination;
|
||
use app\common\logic\BaseLogic;
|
||
use think\facade\Db;
|
||
|
||
|
||
/**
|
||
* 标书审查逻辑
|
||
* Class BidDocumentExaminationLogic
|
||
* @package app\adminapi\logic\bid
|
||
*/
|
||
class BidDocumentExaminationLogic extends BaseLogic
|
||
{
|
||
|
||
|
||
/**
|
||
* @notes 添加标书审查
|
||
* @param array $params
|
||
* @return bool
|
||
* @author likeadmin
|
||
* @date 2023/12/02 09:52
|
||
*/
|
||
public static function add(array $params): bool
|
||
{
|
||
Db::startTrans();
|
||
try {
|
||
BidDocumentExamination::create([
|
||
'approve_id' => $params['approve_id'],
|
||
'buy_bidding_document_id' => $params['buy_bidding_document_id'],
|
||
'is_need_deposit' => $params['is_need_deposit'],
|
||
'bid_opening_date' => strtotime($params['bid_opening_date']),
|
||
'deposit_refund_time' => strtotime($params['deposit_refund_time']),
|
||
'bidding_project_overview' => $params['bidding_project_overview'],
|
||
'project_introduction' => $params['project_introduction'],
|
||
'annex' => $params['annex'],
|
||
'technical_protocol_deviation' => $params['technical_protocol_deviation'],
|
||
'protocol_deviation_handling_plan' => $params['protocol_deviation_handling_plan'],
|
||
'technical_review_annex' => $params['technical_review_annex'],
|
||
'business_review_total_amount' => $params['business_review_total_amount'],
|
||
'tax_rate' => $params['tax_rate'],
|
||
'pay_type' => $params['pay_type'],
|
||
'pay_rate' => $params['pay_rate'],
|
||
'business_contract_deviation' => $params['business_contract_deviation'],
|
||
'business_contract_deviation_handling_plan' => $params['business_contract_deviation_handling_plan'],
|
||
'business_contract_deviation_annex' => $params['business_contract_deviation_annex']
|
||
]);
|
||
|
||
Db::commit();
|
||
return true;
|
||
} catch (\Exception $e) {
|
||
Db::rollback();
|
||
self::setError($e->getMessage());
|
||
return false;
|
||
}
|
||
}
|
||
|
||
|
||
/**
|
||
* @notes 编辑标书审查
|
||
* @param array $params
|
||
* @return bool
|
||
* @author likeadmin
|
||
* @date 2023/12/02 09:52
|
||
*/
|
||
public static function edit(array $params): bool
|
||
{
|
||
Db::startTrans();
|
||
try {
|
||
BidDocumentExamination::where('id', $params['id'])->update([
|
||
'approve_id' => $params['approve_id'],
|
||
'buy_bidding_document_id' => $params['buy_bidding_document_id'],
|
||
'is_need_deposit' => $params['is_need_deposit'],
|
||
'bid_opening_date' => strtotime($params['bid_opening_date']),
|
||
'deposit_refund_time' => strtotime($params['deposit_refund_time']),
|
||
'bidding_project_overview' => $params['bidding_project_overview'],
|
||
'project_introduction' => $params['project_introduction'],
|
||
'annex' => $params['annex'],
|
||
'technical_protocol_deviation' => $params['technical_protocol_deviation'],
|
||
'protocol_deviation_handling_plan' => $params['protocol_deviation_handling_plan'],
|
||
'technical_review_annex' => $params['technical_review_annex'],
|
||
'business_review_total_amount' => $params['business_review_total_amount'],
|
||
'tax_rate' => $params['tax_rate'],
|
||
'pay_type' => $params['pay_type'],
|
||
'pay_rate' => $params['pay_rate'],
|
||
'business_contract_deviation' => $params['business_contract_deviation'],
|
||
'business_contract_deviation_handling_plan' => $params['business_contract_deviation_handling_plan'],
|
||
'business_contract_deviation_annex' => $params['business_contract_deviation_annex']
|
||
]);
|
||
|
||
Db::commit();
|
||
return true;
|
||
} catch (\Exception $e) {
|
||
Db::rollback();
|
||
self::setError($e->getMessage());
|
||
return false;
|
||
}
|
||
}
|
||
|
||
|
||
/**
|
||
* @notes 删除标书审查
|
||
* @param array $params
|
||
* @return bool
|
||
* @author likeadmin
|
||
* @date 2023/12/02 09:52
|
||
*/
|
||
public static function delete(array $params): bool
|
||
{
|
||
return BidDocumentExamination::destroy($params['id']);
|
||
}
|
||
|
||
|
||
/**
|
||
* @notes 获取标书审查详情
|
||
* @param $params
|
||
* @return array
|
||
* @author likeadmin
|
||
* @date 2023/12/02 09:52
|
||
*/
|
||
public static function detail($params): array
|
||
{
|
||
return BidDocumentExamination::findOrEmpty($params['id'])->toArray();
|
||
}
|
||
} |