Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
黄成意
/
yunxin
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
8d8fe6e6
authored
Jun 03, 2019
by
PRY5YKGJ82EZEPX\Administrator
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
更新联营sku库存
parent
2dcb3ba5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
7 deletions
app/Http/function.php
app/Model/Server/ServerFoostoneModel.php
app/Http/function.php
View file @
8d8fe6e6
...
...
@@ -931,7 +931,7 @@ function checkFloat($str){
/*
* 判断大于0 多少位小数
*/
function
checkFloatInt
(
$number
,
$w
=
2
,
$type
=
1
){
function
checkFloatInt
(
$number
,
$w
=
2
){
if
(
preg_match
(
'/^[0-9]+(.[0-9]{1,'
.
$w
.
'})?$/'
,
$number
))
{
return
true
;
}
else
{
...
...
app/Model/Server/ServerFoostoneModel.php
View file @
8d8fe6e6
...
...
@@ -97,6 +97,7 @@ class ServerFoostoneModel
]
*/
public
function
comSkuEdit
(
$data
,
$type
=
1
){
if
(
empty
(
@
$data
[
'goods_id'
]))
return
[
1001
,
'商品id必填'
];
$tdata
[
'goods_id'
]
=
$data
[
'goods_id'
];
$stock
=
@
$data
[
'stock'
];
...
...
@@ -127,17 +128,19 @@ class ServerFoostoneModel
]);
}
foreach
(
$price_cn
as
$a
=>
$b
){
if
(
empty
(
$b
))
continue
;
if
(
!
checkFloatInt
(
$b
,
5
,
2
))
return
[
1007
,
"国内含税价填写不对:"
.
$b
];
if
(
$b
==
'0'
)
return
[
1007
,
"国内含税价填写不对:"
.
$b
];
if
(
$b
===
""
)
continue
;
if
(
!
checkFloatInt
(
$b
,
5
))
return
[
1007
,
"国内含税价填写不对:"
.
$b
];
}
foreach
(
$purchases
as
$c
=>
$d
){
if
(
empty
(
$d
))
continue
;
if
(
!
checkFloatInt
(
$d
,
5
,
2
))
return
[
1007
,
"国内含税价填写不对:"
.
$d
];
foreach
(
$price_us
as
$c
=>
$d
){
if
(
$d
==
'0'
)
return
[
1008
,
"香港含税价填写不对:"
.
$d
];
if
(
$d
===
""
)
continue
;
if
(
!
checkFloatInt
(
$d
,
5
))
return
[
1008
,
"香港含税价填写不对:"
.
$d
];
}
$tdata
[
'ladder_price'
]
=
$ladder_price
;
}
$res
=
$this
->
push
(
'/yunxin/api/pool/sku/edit'
,
$tdata
,
$type
);
return
[
$res
[
'code'
],
$res
[
'errmsg'
]];
}
...
...
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