Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
朱继来
/
后台订单管理
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
9d7f0ab9
authored
Mar 18, 2021
by
朱继来
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
判断用户绑定
parent
5d6f7776
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
0 deletions
app/Http/Controllers/ApiController.php
public/js/add_order.js
app/Http/Controllers/ApiController.php
View file @
9d7f0ab9
...
...
@@ -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
);
}
...
...
public/js/add_order.js
View file @
9d7f0ab9
...
...
@@ -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
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment