Commit 479912fb by duwenjun

关闭报价

parent cfa88507
Showing with 2 additions and 2 deletions
...@@ -515,11 +515,11 @@ class QuoteModel extends Model ...@@ -515,11 +515,11 @@ class QuoteModel extends Model
if ($quote_info['status'] == self::STATUS_CLOSE) { if ($quote_info['status'] == self::STATUS_CLOSE) {
return [1, '关闭失败,该报价已关闭,请刷新页面查看']; return [1, '关闭失败,该报价已关闭,请刷新页面查看'];
} }
if ($quote_info['status'] !== self::STATUS_OFFER) { if (!in_array($quote_info['status'], [self::STATUS_OFFER, self::STATUS_SELECTED, self::STATUS_SURE])) {
return [1, '关闭失败,该报价状态不能关闭']; return [1, '关闭失败,该报价状态不能关闭'];
} }
$res = $this->where('id', $id)->where('status', self::STATUS_OFFER)->update(['status' => self::STATUS_CLOSE]); $res = $this->where('id', $id)->whereIn('status', [self::STATUS_OFFER, self::STATUS_SELECTED, self::STATUS_SURE])->update(['status' => self::STATUS_CLOSE]);
// 查看当前询价明细的报价数量,若为0,则更新询价明细状态为待报价 // 查看当前询价明细的报价数量,若为0,则更新询价明细状态为待报价
$count = $this->where('inquiry_items_id', $quote_info['inquiry_items_id'])->whereNotIn('status', [self::STATUS_CANCEL, self::STATUS_CLOSE, self::STATUS_DEL])->count(); $count = $this->where('inquiry_items_id', $quote_info['inquiry_items_id'])->whereNotIn('status', [self::STATUS_CANCEL, self::STATUS_CLOSE, self::STATUS_DEL])->count();
$InquiryItemsModel = new InquiryItemsModel; $InquiryItemsModel = new InquiryItemsModel;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment