update
This commit is contained in:
parent
74d261bb28
commit
5c24cd4d2b
@ -86,9 +86,12 @@ class MarketingBidInfoController extends BaseAdminController
|
|||||||
public function delete()
|
public function delete()
|
||||||
{
|
{
|
||||||
$params = (new MarketingBidInfoValidate())->post()->goCheck('delete');
|
$params = (new MarketingBidInfoValidate())->post()->goCheck('delete');
|
||||||
MarketingBidInfoLogic::delete($params);
|
$result = MarketingBidInfoLogic::delete($params);
|
||||||
|
if (true === $result) {
|
||||||
return $this->success('删除成功', [], 1, 1);
|
return $this->success('删除成功', [], 1, 1);
|
||||||
}
|
}
|
||||||
|
return $this->fail(MarketingBidInfoLogic::getError());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
use app\common\model\dept\Dept;
|
use app\common\model\dept\Dept;
|
||||||
use app\common\model\marketing\MarketingBidEvaluation;
|
use app\common\model\marketing\MarketingBidEvaluation;
|
||||||
use app\common\model\marketing\MarketingBidInfo;
|
use app\common\model\marketing\MarketingBidInfo;
|
||||||
|
use app\common\model\marketing\MarketingBidResult;
|
||||||
use app\common\model\marketing\MarketingBusinessOpportunity;
|
use app\common\model\marketing\MarketingBusinessOpportunity;
|
||||||
use app\common\model\marketing\MarketingCustom;
|
use app\common\model\marketing\MarketingCustom;
|
||||||
use think\facade\Db;
|
use think\facade\Db;
|
||||||
@ -120,6 +121,11 @@
|
|||||||
*/
|
*/
|
||||||
public static function delete(array $params): bool
|
public static function delete(array $params): bool
|
||||||
{
|
{
|
||||||
|
$bid_result = MarketingBidResult::where('bid_info_id', 'in', $params['id'])->findOrEmpty();
|
||||||
|
if (!$bid_result->isEmpty()) {
|
||||||
|
self::setError('此数据关联了投标结果内容,需删除投标结果内容');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
return MarketingBidInfo::destroy($params['id']);
|
return MarketingBidInfo::destroy($params['id']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user