Commit 9d7f0ab9 by 朱继来

判断用户绑定

parent 5d6f7776
......@@ -11,6 +11,7 @@ use App\Model\Pcb\PcbPublicModel;
use App\Model\Pcb\PcbPurchaseModel;
use App\Model\Pcb\PcbServerModel;
use App\Model\KefuModel;
use App\Model\CrmModel;
use App\Model\CmsModel;
use App\Model\OrderModel;
use App\Model\OrderExtendModel;
......@@ -518,6 +519,7 @@ class ApiController extends Controller
if ($type == 1) {
$com_id = DB::connection('order')->table('lie_invoice_company')->where('com_name', $val)->value('id');
if (!$com_id) $this->Export(-1, '当前公司不存在');
$this->Export(0, '', $com_id);
}
......@@ -529,6 +531,20 @@ class ApiController extends Controller
}
$user_id = DB::connection('order')->table('lie_user_main')->where($field, $val)->value('user_id');
if (!$user_id) $this->Export(-1, '当前联系方式不存在');
// 判断会员是否与当前登录账号绑定
if (strpos($_SERVER['HTTP_HOST'], 'sz') === false) { // 非测试环境下执行
// 若用户已分配,则判断当前登录客服是否能给用户下单,若没分配,按之前流程,订单生成时分配给当前登录客服
$CrmModel = new CrmModel();
$sale_id = $CrmModel->getSaleId($user_id);
if ($sale_id && $sale_id != $request->user->userId) {
$CmsModel = new CmsModel();
$sale_name = $CmsModel->getUserName($sale_id);
$this->Export(-1, '该客户由 '.$sale_name.' 跟进,请联系主管重新指派');
}
}
$this->Export(0, '', $user_id);
}
......
......@@ -37,6 +37,13 @@ layui.config({
dataType: "json",
success: function(resp){
var field = type == 1 ? 'inv_com_id' : 'user_id';
if (resp.errcode != 0) {
$('.' + field).val('');
layer.msg(resp.errmsg);
return false;
}
$('.' + field).val(resp.data);
checkBindUser();
......@@ -808,6 +815,7 @@ layui.config({
// ,limits: [10, 20, 50,]
,done: function(res, curr, count) {
if (res.data.length == 0) {
layer.msg('购物车内无商品');
$('.carts-info').hide();
return false;
}
......
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