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
698e493b
authored
Oct 30, 2018
by
朱继来
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
调整sku接口
parent
a27bbd7b
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
14 deletions
app/Http/Controllers/AddOrderController.php
config/website.php
public/js/add_order.js
app/Http/Controllers/AddOrderController.php
View file @
698e493b
...
@@ -288,12 +288,15 @@ Class AddOrderController extends Controller
...
@@ -288,12 +288,15 @@ Class AddOrderController extends Controller
{
{
if
(
$request
->
isMethod
(
'post'
))
{
if
(
$request
->
isMethod
(
'post'
))
{
$url
=
Config
(
'website.search-skuid'
);
$url
=
Config
(
'website.search-skuid'
);
$data
[
'sku_id'
]
=
$request
->
input
(
'sku_id'
);
$data
[
'id'
]
=
$request
->
input
(
'sku_id'
);
$data
[
'k1'
]
=
time
();
$data
[
'k2'
]
=
md5
(
md5
(
$data
[
'k1'
])
.
'fh6y5t4rr351d2c3bryi'
);
$response
=
json_decode
(
curlApi
(
$url
,
$data
,
'POST'
),
true
);
$response
=
json_decode
(
curlApi
(
$url
,
$data
,
'POST'
),
true
);
if
(
!
empty
(
$response
[
'data'
]
[
'data'
]
))
{
if
(
!
empty
(
$response
[
'data'
]))
{
return
[
'errcode'
=>
0
,
'errmsg'
=>
''
,
'data'
=>
$response
[
'data'
]
[
'data'
][
$data
[
'sku_id'
]]
];
return
[
'errcode'
=>
0
,
'errmsg'
=>
''
,
'data'
=>
$response
[
'data'
]];
}
else
{
}
else
{
return
[
'errcode'
=>
-
1
,
'errmsg'
=>
'未找SKU信息'
];
return
[
'errcode'
=>
-
1
,
'errmsg'
=>
'未找SKU信息'
];
}
}
...
...
config/website.php
View file @
698e493b
...
@@ -52,7 +52,8 @@ return [
...
@@ -52,7 +52,8 @@ return [
// 查询SKUID接口
// 查询SKUID接口
// 'search-skuid' => 'http://footstone.liexin.net/webapi/sku_list',
// 'search-skuid' => 'http://footstone.liexin.net/webapi/sku_list',
'search-skuid'
=>
'http://www.liexin.com/v3/sku/list'
,
// 'search-skuid' => 'http://www.liexin.com/v3/sku/list',
'search-skuid'
=>
'http://api.liexin.com/goods/detail'
,
// 新增SKU入口
// 新增SKU入口
'add-sku-url'
=>
'http://footstone.liexin.net/manage/addsku'
,
'add-sku-url'
=>
'http://footstone.liexin.net/manage/addsku'
,
...
...
public/js/add_order.js
View file @
698e493b
...
@@ -222,7 +222,7 @@
...
@@ -222,7 +222,7 @@
type
:
'post'
,
type
:
'post'
,
data
:
{
sku_id
:
sku_id
.
trim
()},
data
:
{
sku_id
:
sku_id
.
trim
()},
dataType
:
'json'
,
dataType
:
'json'
,
success
:
function
(
resp
)
{
success
:
function
(
resp
)
{
console
.
log
(
resp
)
if
(
resp
.
errcode
!=
0
)
{
if
(
resp
.
errcode
!=
0
)
{
layer
.
msg
(
resp
.
errmsg
);
layer
.
msg
(
resp
.
errmsg
);
return
false
;
return
false
;
...
@@ -236,9 +236,9 @@
...
@@ -236,9 +236,9 @@
$
(
'.goods_name'
).
text
(
data
.
goods_name
);
$
(
'.goods_name'
).
text
(
data
.
goods_name
);
$
(
'.brand_name'
).
text
(
data
.
brand_name
);
$
(
'.brand_name'
).
text
(
data
.
brand_name
);
$
(
'.supplier_name'
).
text
(
data
.
supplier_name
);
$
(
'.supplier_name'
).
text
(
data
.
supplier_name
);
$
(
'.stock'
).
text
(
data
.
stock
);
$
(
'.stock'
).
text
(
data
.
goods_number
);
$
(
'.moq'
).
text
(
data
.
m
oq
);
$
(
'.moq'
).
text
(
data
.
m
in_buy
);
$
(
'.mpq'
).
text
(
data
.
mpq
);
$
(
'.mpq'
).
text
(
data
.
m
in_m
pq
);
if
(
goods_type
==
1
)
{
if
(
goods_type
==
1
)
{
var
status
=
data
.
goods_status
;
var
status
=
data
.
goods_status
;
...
@@ -258,8 +258,8 @@
...
@@ -258,8 +258,8 @@
$
(
'.goods_type'
).
val
(
data
.
goods_type
);
$
(
'.goods_type'
).
val
(
data
.
goods_type
);
//阶梯价格
//阶梯价格
if
(
data
.
ladder_price
!=
null
)
{
if
(
data
.
tiered
!=
null
)
{
var
len
=
data
.
ladder_price
.
length
;
var
len
=
data
.
tiered
.
length
;
if
(
len
>
0
)
{
if
(
len
>
0
)
{
var
html
=
''
;
var
html
=
''
;
var
str
=
''
;
var
str
=
''
;
...
@@ -267,16 +267,16 @@
...
@@ -267,16 +267,16 @@
for
(
var
i
=
0
;
i
<
len
;
i
++
)
{
for
(
var
i
=
0
;
i
<
len
;
i
++
)
{
if
(
i
==
0
)
{
if
(
i
==
0
)
{
if
(
goods_type
==
1
)
{
if
(
goods_type
==
1
)
{
str
=
'<td>$<span class="goods-min-price-us">'
+
data
.
ladder_price
[
i
][
'price_us'
]
+
'</span></td>'
;
str
=
'<td>$<span class="goods-min-price-us">'
+
data
.
tiered
[
i
][
'price_us'
]
+
'</span></td>'
;
}
}
html
+=
'<tr><td><span class="goods-min-num">'
+
data
.
ladder_price
[
i
][
'purchases'
]
+
'</span></td><td>¥<span class="goods-min-price">'
+
data
.
ladder_price
[
i
][
'price_cn'
]
+
'</span></td>'
+
str
+
'</tr>'
;
html
+=
'<tr><td><span class="goods-min-num">'
+
data
.
tiered
[
i
][
'purchases'
]
+
'</span></td><td>¥<span class="goods-min-price">'
+
data
.
tiered
[
i
][
'price_cn'
]
+
'</span></td>'
+
str
+
'</tr>'
;
}
else
{
}
else
{
if
(
goods_type
==
1
)
{
if
(
goods_type
==
1
)
{
str
=
'<td>$<span>'
+
data
.
ladder_price
[
i
][
'price_us'
]
+
'</span></td>'
;
str
=
'<td>$<span>'
+
data
.
tiered
[
i
][
'price_us'
]
+
'</span></td>'
;
}
}
html
+=
'<tr><td><span>'
+
data
.
ladder_price
[
i
][
'purchases'
]
+
'</span></td><td>¥<span>'
+
data
.
ladder_price
[
i
][
'price_cn'
]
+
'</span></td>'
+
str
+
'</tr>'
;
html
+=
'<tr><td><span>'
+
data
.
tiered
[
i
][
'purchases'
]
+
'</span></td><td>¥<span>'
+
data
.
tiered
[
i
][
'price_cn'
]
+
'</span></td>'
+
str
+
'</tr>'
;
}
}
}
}
...
...
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