Commit 29ba3be8 by 朱继来

推送信息

parent e4fb599d
Showing with 41 additions and 6 deletions
......@@ -233,6 +233,13 @@ class QuoteModel extends Model
$data['create_name'] = $input['user_name'];
OpLogModel::log($data);
// 推送消息
$InquiryModel = new InquiryModel;
$inquiry_uid = $InquiryModel->where('id', $quote_info['inquiry_id'])->value('create_uid'); // 询价人
$contents = $input['user_name'].'已撤销报价,请及时查看!报价单号:'.$quote_info['quote_sn'].',型号:'.$quote_info['goods_name'];
$CommonModel->send_msg($inquiry_uid, $contents);
} catch (Exception $e) {
return [1, $e->getMessage()];
}
......@@ -276,11 +283,11 @@ class QuoteModel extends Model
$v["class_id2"] = $classInfo["class_id2"];
$v["class_id2_name"] = $classInfo["class_id2_name"];
}
}
}
if ($v['currency'] == 2) { // 美元需计算汇率(排序用)
$v['price_rmb'] = $rate ? number_format($v['price_origin'] * $rate, 6) : 0;
}
if ($v['currency'] == 2) {
$v['price_rmb'] = $rate ? number_format($v['price_origin'] * $rate, 6) : 0; // 美元需计算汇率(排序用)
}
$quote_sn = $this->where(["inquiry_items_id"=>$inquiry_items_id,"raw_goods_sn"=>$v["raw_goods_sn"]])->value("quote_sn");
if ($quote_sn){ #存在更新
......@@ -316,6 +323,16 @@ class QuoteModel extends Model
RedisDB::sadd('frq_quote_urge', $inquiry_items_id);
$con->commit();
// 推送消息
$inquiry_id = InquiryItemsModel::where('id', $inquiry_items_id)->value('inquiry_id');
$InquiryModel = new InquiryModel;
$inquiry_uid = $InquiryModel->where('id', $inquiry_id)->value('create_uid'); // 询价人
$contents = '系统自动报价,请及时查看!';
$CommonModel->send_msg($inquiry_uid, $contents);
return [0,"新增成功"];
}catch (\Exception $e) {
$con->rollBack();
......@@ -405,7 +422,7 @@ class QuoteModel extends Model
$price = '$'.$quote_info['price_origin'];
}
$contents = $input['user_name'].'已报价,请及时查看!报价单号:'.$quote_info['quote_sn'].',单价:'.$price;
$contents = $input['user_name'].'已报价,请及时查看!报价单号:'.$quote_info['quote_sn'].',型号:'.$quote_info['goods_name'].',单价:'.$price;
$CommonModel->send_msg($inquiry_uid, $contents);
} catch (Exception $e) {
return [1, $e->getMessage()];
......@@ -718,15 +735,33 @@ class QuoteModel extends Model
$this->where('id', $input['quote_id'])->update($quote_info);
if ($quote_info['currency'] == 1) {
$price = '¥'.$quote_info['price_rmb'];
$price_log = '含税单价:'.$quote_info['price_rmb'];
} else {
$price = '$'.$quote_info['price_origin'];
$price_log = '单价:'.$quote_info['price_origin'];
}
$content = '修改报价,报价单号:'.$input['quote_sn'].',型号:'.$input['goods_name'].$price_log.',批次:'.$input['batch'].',货期:'.$input['delivery_time'];
$data = [];
$data['types'] = 2;
$data['relation_id'] = $input['quote_id'];
$data['relation_sn'] = $input['quote_sn'];
$data['content'] = '修改报价,报价单号:'.$input['quote_sn'];
$data['content'] = $content;
$data['create_uid'] = $input['user_id'];
$data['create_name'] = $input['user_name'];
OpLogModel::log($data);
// 推送消息
$InquiryModel = new InquiryModel;
$inquiry_uid = $InquiryModel->where('id', $quote_info['inquiry_id'])->value('create_uid'); // 询价人
$contents = $input['user_name'].$content;
$CommonModel->send_msg($inquiry_uid, $contents);
} catch (Exception $e) {
return [1, $e->getMessage()];
}
......
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