update
This commit is contained in:
parent
5c24cd4d2b
commit
e07b515620
@ -12,21 +12,21 @@
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\lists\marketing;
|
||||
namespace app\adminapi\lists\marketing;
|
||||
|
||||
|
||||
use app\adminapi\lists\BaseAdminDataLists;
|
||||
use app\common\model\marketing\MarketingBidResultDetail;
|
||||
use app\common\lists\ListsSearchInterface;
|
||||
use app\adminapi\lists\BaseAdminDataLists;
|
||||
use app\common\lists\ListsSearchInterface;
|
||||
use app\common\model\marketing\MarketingBidResultDetail;
|
||||
|
||||
|
||||
/**
|
||||
/**
|
||||
* 市场经营--投标管理--投标结果--参标单位列表
|
||||
* Class MarketingBidResultDetailLists
|
||||
* @package app\adminapi\listsmarketing
|
||||
*/
|
||||
class MarketingBidResultDetailLists extends BaseAdminDataLists implements ListsSearchInterface
|
||||
{
|
||||
class MarketingBidResultDetailLists extends BaseAdminDataLists implements ListsSearchInterface
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
@ -74,4 +74,4 @@ class MarketingBidResultDetailLists extends BaseAdminDataLists implements ListsS
|
||||
return MarketingBidResultDetail::where($this->searchWhere)->count();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -12,21 +12,21 @@
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\logic\marketing;
|
||||
namespace app\adminapi\logic\marketing;
|
||||
|
||||
|
||||
use app\common\model\marketing\MarketingBidResultDetail;
|
||||
use app\common\logic\BaseLogic;
|
||||
use think\facade\Db;
|
||||
use app\common\logic\BaseLogic;
|
||||
use app\common\model\marketing\MarketingBidResultDetail;
|
||||
use think\facade\Db;
|
||||
|
||||
|
||||
/**
|
||||
/**
|
||||
* 市场经营--投标管理--投标结果--参标单位逻辑
|
||||
* Class MarketingBidResultDetailLogic
|
||||
* @package app\adminapi\logic\marketing
|
||||
*/
|
||||
class MarketingBidResultDetailLogic extends BaseLogic
|
||||
{
|
||||
class MarketingBidResultDetailLogic extends BaseLogic
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
@ -43,15 +43,14 @@ class MarketingBidResultDetailLogic extends BaseLogic
|
||||
MarketingBidResultDetail::create([
|
||||
'bid_result_id' => $params['bid_result_id'],
|
||||
'company' => $params['company'],
|
||||
'quotation_one' => $params['quotation_one'],
|
||||
'quotation_two' => $params['quotation_two'],
|
||||
'quotation_three' => $params['quotation_three'],
|
||||
'final_rate' => $params['final_rate'],
|
||||
'manager' => $params['manager'],
|
||||
'month' => $params['month'],
|
||||
'result' => $params['result'],
|
||||
'quotation_one' => $params['quotation_one'] ?? 0,
|
||||
'quotation_two' => $params['quotation_two'] ?? 0,
|
||||
'quotation_three' => $params['quotation_three'] ?? 0,
|
||||
'final_rate' => $params['final_rate'] ?? 0,
|
||||
'manager' => $params['manager'] ?? '',
|
||||
'month' => $params['month'] ?? '',
|
||||
'result' => $params['result'] ?? 0,
|
||||
]);
|
||||
|
||||
Db::commit();
|
||||
return true;
|
||||
} catch (\Exception $e) {
|
||||
@ -76,15 +75,14 @@ class MarketingBidResultDetailLogic extends BaseLogic
|
||||
MarketingBidResultDetail::where('id', $params['id'])->update([
|
||||
'bid_result_id' => $params['bid_result_id'],
|
||||
'company' => $params['company'],
|
||||
'quotation_one' => $params['quotation_one'],
|
||||
'quotation_two' => $params['quotation_two'],
|
||||
'quotation_three' => $params['quotation_three'],
|
||||
'final_rate' => $params['final_rate'],
|
||||
'manager' => $params['manager'],
|
||||
'month' => $params['month'],
|
||||
'result' => $params['result'],
|
||||
'quotation_one' => $params['quotation_one'] ?? 0,
|
||||
'quotation_two' => $params['quotation_two'] ?? 0,
|
||||
'quotation_three' => $params['quotation_three'] ?? 0,
|
||||
'final_rate' => $params['final_rate'] ?? 0,
|
||||
'manager' => $params['manager'] ?? '',
|
||||
'month' => $params['month'] ?? '',
|
||||
'result' => $params['result'] ?? 0,
|
||||
]);
|
||||
|
||||
Db::commit();
|
||||
return true;
|
||||
} catch (\Exception $e) {
|
||||
@ -119,4 +117,4 @@ class MarketingBidResultDetailLogic extends BaseLogic
|
||||
{
|
||||
return MarketingBidResultDetail::findOrEmpty($params['id'])->toArray();
|
||||
}
|
||||
}
|
||||
}
|
@ -12,35 +12,35 @@
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\validate\marketing;
|
||||
namespace app\adminapi\validate\marketing;
|
||||
|
||||
|
||||
use app\common\validate\BaseValidate;
|
||||
use app\common\model\marketing\MarketingBidResult;
|
||||
use app\common\model\marketing\MarketingBidResultDetail;
|
||||
use app\common\validate\BaseValidate;
|
||||
|
||||
|
||||
/**
|
||||
/**
|
||||
* 市场经营--投标管理--投标结果--参标单位验证器
|
||||
* Class MarketingBidResultDetailValidate
|
||||
* @package app\adminapi\validate\marketing
|
||||
*/
|
||||
class MarketingBidResultDetailValidate extends BaseValidate
|
||||
{
|
||||
class MarketingBidResultDetailValidate extends BaseValidate
|
||||
{
|
||||
|
||||
/**
|
||||
* 设置校验规则
|
||||
* @var string[]
|
||||
*/
|
||||
protected $rule = [
|
||||
'id' => 'require',
|
||||
'bid_result_id' => 'require',
|
||||
'id' => 'require|checkData',
|
||||
'bid_result_id' => 'require|checkBidResult',
|
||||
'company' => 'require',
|
||||
'quotation_one' => 'require',
|
||||
'quotation_two' => 'require',
|
||||
'quotation_three' => 'require',
|
||||
'final_rate' => 'require',
|
||||
'manager' => 'require',
|
||||
'month' => 'require',
|
||||
'result' => 'require',
|
||||
'quotation_one' => 'float|egt:0',
|
||||
'quotation_two' => 'float|egt:0',
|
||||
'quotation_three' => 'float|egt:0',
|
||||
'final_rate' => 'float|egt:0',
|
||||
'result' => 'integer|in:0,1',
|
||||
];
|
||||
|
||||
|
||||
@ -70,7 +70,7 @@ class MarketingBidResultDetailValidate extends BaseValidate
|
||||
*/
|
||||
public function sceneAdd()
|
||||
{
|
||||
return $this->only(['bid_result_id','company','quotation_one','quotation_two','quotation_three','final_rate','manager','month','result']);
|
||||
return $this->only(['bid_result_id', 'company', 'quotation_one', 'quotation_two', 'quotation_three', 'final_rate', 'manager', 'month', 'result']);
|
||||
}
|
||||
|
||||
|
||||
@ -82,7 +82,7 @@ class MarketingBidResultDetailValidate extends BaseValidate
|
||||
*/
|
||||
public function sceneEdit()
|
||||
{
|
||||
return $this->only(['id','bid_result_id','company','quotation_one','quotation_two','quotation_three','final_rate','manager','month','result']);
|
||||
return $this->only(['id', 'bid_result_id', 'company', 'quotation_one', 'quotation_two', 'quotation_three', 'final_rate', 'manager', 'month', 'result']);
|
||||
}
|
||||
|
||||
|
||||
@ -109,4 +109,15 @@ class MarketingBidResultDetailValidate extends BaseValidate
|
||||
return $this->only(['id']);
|
||||
}
|
||||
|
||||
}
|
||||
public function checkData($value): bool|string
|
||||
{
|
||||
$data = MarketingBidResultDetail::where('id', $value)->findOrEmpty();
|
||||
return $data->isEmpty() ? '数据不存在' : true;
|
||||
}
|
||||
|
||||
public function checkBidResult($value): bool|string
|
||||
{
|
||||
$data = MarketingBidResult::where('id', $value)->findOrEmpty();
|
||||
return $data->isEmpty() ? '投标信息数据不存在' : true;
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user