update
This commit is contained in:
parent
5c24cd4d2b
commit
e07b515620
@ -12,21 +12,21 @@
|
|||||||
// | author: likeadminTeam
|
// | author: likeadminTeam
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
|
|
||||||
namespace app\adminapi\lists\marketing;
|
namespace app\adminapi\lists\marketing;
|
||||||
|
|
||||||
|
|
||||||
use app\adminapi\lists\BaseAdminDataLists;
|
use app\adminapi\lists\BaseAdminDataLists;
|
||||||
use app\common\model\marketing\MarketingBidResultDetail;
|
use app\common\lists\ListsSearchInterface;
|
||||||
use app\common\lists\ListsSearchInterface;
|
use app\common\model\marketing\MarketingBidResultDetail;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 市场经营--投标管理--投标结果--参标单位列表
|
* 市场经营--投标管理--投标结果--参标单位列表
|
||||||
* Class MarketingBidResultDetailLists
|
* Class MarketingBidResultDetailLists
|
||||||
* @package app\adminapi\listsmarketing
|
* @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();
|
return MarketingBidResultDetail::where($this->searchWhere)->count();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -12,21 +12,21 @@
|
|||||||
// | author: likeadminTeam
|
// | author: likeadminTeam
|
||||||
// +----------------------------------------------------------------------
|
// +----------------------------------------------------------------------
|
||||||
|
|
||||||
namespace app\adminapi\logic\marketing;
|
namespace app\adminapi\logic\marketing;
|
||||||
|
|
||||||
|
|
||||||
use app\common\model\marketing\MarketingBidResultDetail;
|
use app\common\logic\BaseLogic;
|
||||||
use app\common\logic\BaseLogic;
|
use app\common\model\marketing\MarketingBidResultDetail;
|
||||||
use think\facade\Db;
|
use think\facade\Db;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 市场经营--投标管理--投标结果--参标单位逻辑
|
* 市场经营--投标管理--投标结果--参标单位逻辑
|
||||||
* Class MarketingBidResultDetailLogic
|
* Class MarketingBidResultDetailLogic
|
||||||
* @package app\adminapi\logic\marketing
|
* @package app\adminapi\logic\marketing
|
||||||
*/
|
*/
|
||||||
class MarketingBidResultDetailLogic extends BaseLogic
|
class MarketingBidResultDetailLogic extends BaseLogic
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -43,15 +43,14 @@ class MarketingBidResultDetailLogic extends BaseLogic
|
|||||||
MarketingBidResultDetail::create([
|
MarketingBidResultDetail::create([
|
||||||
'bid_result_id' => $params['bid_result_id'],
|
'bid_result_id' => $params['bid_result_id'],
|
||||||
'company' => $params['company'],
|
'company' => $params['company'],
|
||||||
'quotation_one' => $params['quotation_one'],
|
'quotation_one' => $params['quotation_one'] ?? 0,
|
||||||
'quotation_two' => $params['quotation_two'],
|
'quotation_two' => $params['quotation_two'] ?? 0,
|
||||||
'quotation_three' => $params['quotation_three'],
|
'quotation_three' => $params['quotation_three'] ?? 0,
|
||||||
'final_rate' => $params['final_rate'],
|
'final_rate' => $params['final_rate'] ?? 0,
|
||||||
'manager' => $params['manager'],
|
'manager' => $params['manager'] ?? '',
|
||||||
'month' => $params['month'],
|
'month' => $params['month'] ?? '',
|
||||||
'result' => $params['result'],
|
'result' => $params['result'] ?? 0,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
Db::commit();
|
Db::commit();
|
||||||
return true;
|
return true;
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
@ -76,15 +75,14 @@ class MarketingBidResultDetailLogic extends BaseLogic
|
|||||||
MarketingBidResultDetail::where('id', $params['id'])->update([
|
MarketingBidResultDetail::where('id', $params['id'])->update([
|
||||||
'bid_result_id' => $params['bid_result_id'],
|
'bid_result_id' => $params['bid_result_id'],
|
||||||
'company' => $params['company'],
|
'company' => $params['company'],
|
||||||
'quotation_one' => $params['quotation_one'],
|
'quotation_one' => $params['quotation_one'] ?? 0,
|
||||||
'quotation_two' => $params['quotation_two'],
|
'quotation_two' => $params['quotation_two'] ?? 0,
|
||||||
'quotation_three' => $params['quotation_three'],
|
'quotation_three' => $params['quotation_three'] ?? 0,
|
||||||
'final_rate' => $params['final_rate'],
|
'final_rate' => $params['final_rate'] ?? 0,
|
||||||
'manager' => $params['manager'],
|
'manager' => $params['manager'] ?? '',
|
||||||
'month' => $params['month'],
|
'month' => $params['month'] ?? '',
|
||||||
'result' => $params['result'],
|
'result' => $params['result'] ?? 0,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
Db::commit();
|
Db::commit();
|
||||||
return true;
|
return true;
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
@ -119,4 +117,4 @@ class MarketingBidResultDetailLogic extends BaseLogic
|
|||||||
{
|
{
|
||||||
return MarketingBidResultDetail::findOrEmpty($params['id'])->toArray();
|
return MarketingBidResultDetail::findOrEmpty($params['id'])->toArray();
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -12,35 +12,35 @@
|
|||||||
// | author: likeadminTeam
|
// | 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
|
* Class MarketingBidResultDetailValidate
|
||||||
* @package app\adminapi\validate\marketing
|
* @package app\adminapi\validate\marketing
|
||||||
*/
|
*/
|
||||||
class MarketingBidResultDetailValidate extends BaseValidate
|
class MarketingBidResultDetailValidate extends BaseValidate
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 设置校验规则
|
* 设置校验规则
|
||||||
* @var string[]
|
* @var string[]
|
||||||
*/
|
*/
|
||||||
protected $rule = [
|
protected $rule = [
|
||||||
'id' => 'require',
|
'id' => 'require|checkData',
|
||||||
'bid_result_id' => 'require',
|
'bid_result_id' => 'require|checkBidResult',
|
||||||
'company' => 'require',
|
'company' => 'require',
|
||||||
'quotation_one' => 'require',
|
'quotation_one' => 'float|egt:0',
|
||||||
'quotation_two' => 'require',
|
'quotation_two' => 'float|egt:0',
|
||||||
'quotation_three' => 'require',
|
'quotation_three' => 'float|egt:0',
|
||||||
'final_rate' => 'require',
|
'final_rate' => 'float|egt:0',
|
||||||
'manager' => 'require',
|
'result' => 'integer|in:0,1',
|
||||||
'month' => 'require',
|
|
||||||
'result' => 'require',
|
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
@ -70,7 +70,7 @@ class MarketingBidResultDetailValidate extends BaseValidate
|
|||||||
*/
|
*/
|
||||||
public function sceneAdd()
|
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()
|
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']);
|
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