Commit 1004af55 by hcy001
parents 53c81d6a 1283ab75
...@@ -247,7 +247,7 @@ class InquiryModel extends Model ...@@ -247,7 +247,7 @@ class InquiryModel extends Model
->where('c.assign_uid', $user_id); ->where('c.assign_uid', $user_id);
} }
$list = $list->select(DB::Raw("lie_a.inquiry_sn,lie_a.currency,lie_a.status as status_a,lie_a.user_name,lie_a.com_name,lie_a.create_name,lie_a.create_time as inquiry_ctime,lie_b.*")) $list = $list->select(DB::Raw("lie_a.inquiry_sn,lie_a.currency,lie_a.status as status_a,lie_a.user_name,lie_a.com_name,lie_a.create_name,lie_a.create_time as inquiry_ctime, lie_b.*, lie_c.id as c_id, lie_c.assign_type as c_assign_type"))
->where(function ($query) use ($input, $type, $user_id) { ->where(function ($query) use ($input, $type, $user_id) {
foreach ($input as $k => $v) { foreach ($input as $k => $v) {
$v = trim($v); $v = trim($v);
...@@ -270,7 +270,7 @@ class InquiryModel extends Model ...@@ -270,7 +270,7 @@ class InquiryModel extends Model
$query->where('a.create_uid', '=', $v); $query->where('a.create_uid', '=', $v);
break; break;
case "assign_type": case "assign_type":
$query->where('b.assign_type', '=', $v); $query->where('c.assign_type', '=', $v);
break; break;
case "start_time": case "start_time":
$query->where('a.create_time', '>=', strtotime($v)); $query->where('a.create_time', '>=', strtotime($v));
...@@ -329,7 +329,7 @@ class InquiryModel extends Model ...@@ -329,7 +329,7 @@ class InquiryModel extends Model
$v['target_price'] = $currency_sign . $v['target_price']; // 客户目标报价 $v['target_price'] = $currency_sign . $v['target_price']; // 客户目标报价
if ($type == 2) { // 已领取的询价列表 if ($type == 2) { // 已领取的询价列表
$v['assign_type_val'] = $v['assign_type'] == 1 ? '指定' : '领取'; // 指定/领取 $v['assign_type_val'] = $v['c_assign_type'] == 1 ? '指定' : '领取'; // 指定/领取
$price_field = $v['currency'] == 1 ? 'price_rmb' : 'price_origin'; $price_field = $v['currency'] == 1 ? 'price_rmb' : 'price_origin';
$quote = $QuoteModel->where(['inquiry_items_id' => $v['id'], 'create_uid' => $user_id])->orderBy('id', 'desc')->first(); $quote = $QuoteModel->where(['inquiry_items_id' => $v['id'], 'create_uid' => $user_id])->orderBy('id', 'desc')->first();
......
...@@ -282,9 +282,15 @@ class QuoteModel extends Model ...@@ -282,9 +282,15 @@ class QuoteModel extends Model
// 查看当前询价明细的报价数量,若为0,则更新询价明细状态为待报价 // 查看当前询价明细的报价数量,若为0,则更新询价明细状态为待报价
$count = $this->where('inquiry_items_id', $quote_info['inquiry_items_id'])->where('status', '<>', -1)->count(); $count = $this->where('inquiry_items_id', $quote_info['inquiry_items_id'])->where('status', '<>', -1)->count();
$InquiryItemsModel = new InquiryItemsModel;
if (!$count) { if (!$count) {
$InquiryItemsModel = new InquiryItemsModel;
$InquiryItemsModel->where('id', $quote_info['inquiry_items_id'])->update(['status' => 1]); $InquiryItemsModel->where('id', $quote_info['inquiry_items_id'])->update(['status' => 1]);
} else { // 若不为0,且该询价明细状态为‘已选中’,则更新为已报价
$status = $InquiryItemsModel->where('inquiry_items_id', $quote_info['inquiry_items_id'])->value('status');
if ($status == 3) {
$InquiryItemsModel->where('id', $quote_info['inquiry_items_id'])->update(['status' => 2]);
}
} }
$data = []; $data = [];
...@@ -859,6 +865,8 @@ class QuoteModel extends Model ...@@ -859,6 +865,8 @@ class QuoteModel extends Model
$quote_info['class_id2_name'] = $classInfo['class_id2_name']; $quote_info['class_id2_name'] = $classInfo['class_id2_name'];
} }
$delivery_time = $quote_info['delivery_time'].$quote_info['delivery_time_unit'];
$quote_info['delivery_time'] = $quote_info['delivery_time_unit'] == '天' ? $quote_info['delivery_time'] : $quote_info['delivery_time'] * 7; $quote_info['delivery_time'] = $quote_info['delivery_time_unit'] == '天' ? $quote_info['delivery_time'] : $quote_info['delivery_time'] * 7;
unset($quote_info['delivery_time_unit']); unset($quote_info['delivery_time_unit']);
...@@ -870,7 +878,7 @@ class QuoteModel extends Model ...@@ -870,7 +878,7 @@ class QuoteModel extends Model
$price_log = '单价:'.array_get(Config('quote.currency_sign'), $quote_info['currency'], '¥').$quote_info['price_origin']; $price_log = '单价:'.array_get(Config('quote.currency_sign'), $quote_info['currency'], '¥').$quote_info['price_origin'];
} }
$content = '修改报价,报价单号:'.$input['quote_sn'].',型号:'.$quote_info['goods_name'].','.$price_log.',批次:'.$quote_info['batch'].',货期:'.$quote_info['delivery_time']; $content = '修改报价,报价单号:'.$input['quote_sn'].',型号:'.$quote_info['goods_name'].','.$price_log.',批次:'.$quote_info['batch'].',货期:'.$delivery_time;
$data = []; $data = [];
$data['types'] = 2; $data['types'] = 2;
......
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