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
c1ade109
authored
Jun 18, 2020
by
孙龙
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
up
parent
11556af5
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
5 deletions
app/Services/Bom/BomService.php
config/website.php
public/js/web/BomView.js
app/Services/Bom/BomService.php
View file @
c1ade109
...
...
@@ -427,7 +427,7 @@ class BomService {
$err_msg
=
[];
$data
=
$request
->
input
(
"data"
,
''
);
$bom_id
=
$data
[
0
][
"bom_id"
];
$bom
=
BomModel
::
where
([
"bom_id"
=>
intval
(
$bom_id
)])
->
select
(
"user_id"
,
"where"
)
->
first
();
$bom
=
BomModel
::
where
([
"bom_id"
=>
intval
(
$bom_id
)])
->
select
(
"user_id"
,
"where"
,
"bom_sn"
)
->
first
();
$user_id
=
$bom
->
user_id
;
$bom_where
=
$bom
->
where
;
$delivery_type
=
0
;
//交货地
...
...
@@ -447,6 +447,7 @@ class BomService {
$extend
[
"delivery_type"
]
=
$delivery_type
;
$extend
[
"currency"
]
=
$currency
;
$extend
[
"bom_id"
]
=
$bom_id
;
$extend
[
"bom_sn"
]
=
$bom
->
bom_sn
;
$address_id
=
$this
->
getAddress
(
$user_id
);
$extend
[
"address_id"
]
=
$address_id
;
$ziying
=
[];
...
...
@@ -472,6 +473,7 @@ class BomService {
$lianying
[
$k
][
"delivery_time"
]
=
$item
[
'match_delivery'
];
$lianying
[
$k
][
"supplier_name"
]
=
$item
[
'match_supplier_name'
];
$lianying
[
$k
][
"id"
]
=
$item
[
'match_goods_id'
];
$ziying
[
$k
][
"matching_id"
]
=
$item
[
"matching_id"
];
}
}
...
...
@@ -497,6 +499,7 @@ class BomService {
protected
function
lyOrder
(
$user_id
,
$lianying
,
$extend
,
&
$err_msg
){
//创建购物车
$lyShopCart
=
$this
->
createLYOrderToShopCart
(
$user_id
,
$lianying
,
$extend
,
$err_msg
);
// exit;
if
(
!
empty
(
$lyShopCart
)
&&
$lyShopCart
[
'err_code'
]
==
0
){
//加入购物车成功
//获取联营购物车
$car_ids
=
$this
->
getShopCart
(
$user_id
,
1
);
...
...
@@ -529,7 +532,7 @@ class BomService {
*/
protected
function
createLYOrderToShopCart
(
$user_id
,
$lianying
,
$extend
){
$url
=
Config
(
'website.addlyorder_url'
);
$data
[
'bom_id'
]
=
$extend
[
"bom_id
"
];
$data
[
"bom_sn"
]
=
$extend
[
"bom_sn
"
];
$data
[
'uid'
]
=
intval
(
$user_id
)
?
intval
(
$user_id
)
:
0
;
$data
[
"type"
]
=
2
;
//1-前台,2-后台,3-后台批量添加
$data
[
'delivery_place'
]
=
$extend
[
"delivery_type"
];
...
...
@@ -549,6 +552,7 @@ class BomService {
protected
function
zyOrder
(
$user_id
,
$ziying
,
$extend
,
&
$err_msg
){
//请求 api接口 加入购物车
$addZYShopCart
=
$this
->
createZYOrderToShopCart
(
$user_id
,
$ziying
,
$extend
);
// exit;
if
(
!
empty
(
$addZYShopCart
)
&&
$addZYShopCart
[
'err_code'
]
==
0
){
//加入购物车成功
//获取自营购物车
$car_ids
=
$this
->
getShopCart
(
$user_id
,
3
);
...
...
@@ -586,6 +590,7 @@ class BomService {
$data
[
'address_id'
]
=
$extend
[
"address_id"
];
$data
[
'k1'
]
=
time
();
$data
[
'k2'
]
=
md5
(
md5
(
$data
[
'k1'
])
.
'fh6y5t4rr351d2c3bryi'
);
// dump(curlApi($url, $data, 'POST'));exit;
$response
=
json_decode
(
curlApi
(
$url
,
$data
,
'POST'
),
true
);
return
$response
;
}
...
...
@@ -616,6 +621,7 @@ class BomService {
$url
=
Config
(
'website.addzyorder_url'
);
$data
[
'type'
]
=
2
;
//后台加入购物车
$data
[
'delivery_place'
]
=
$extend
[
'delivery_type'
];
$data
[
"bom_sn"
]
=
$extend
[
"bom_sn"
];
$data
[
"data"
]
=
array_merge
(
$ziying
);
$data
[
'uid'
]
=
intval
(
$user_id
)
?
intval
(
$user_id
)
:
0
;
$data
[
'k1'
]
=
time
();
...
...
config/website.php
View file @
c1ade109
...
...
@@ -60,13 +60,13 @@ return [
'search-skuid-finalInfo'
=>
'http://api.liexin.com/cart/bomOrderGetFinalGoods'
,
//
批量下自营订单
//
自营订单添加购物车
'addzyorder_url'
=>
'http://api.liexin.com/cart/addBatch'
,
//联营
//联营
加入购物车
'addlyorder_url'
=>
'http://api.liexin.com/cart/addBatchByOrderSystem'
,
//创建订单
//
bom
创建订单
'api_create_order'
=>
'http://api.liexin.com/order/create'
,
// 新增SKU入口
...
...
public/js/web/BomView.js
View file @
c1ade109
...
...
@@ -76,6 +76,7 @@ layui.use(['form', 'table', 'laydate'], function() {
console
.
log
(
err
)
}
})
layer
.
msg
(
'请耐心等待....'
,
{
icon
:
16
,
time
:
5000
,
shade
:
0.3
})
return
false
;
},
cancel
:
function
(
index
)
{
...
...
@@ -109,6 +110,7 @@ layui.use(['form', 'table', 'laydate'], function() {
console
.
log
(
err
)
}
})
layer
.
msg
(
'请耐心等待....'
,
{
icon
:
16
,
time
:
10000
,
shade
:
0.3
})
return
false
;
},
cancel
:
function
(
index
)
{
...
...
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