v1.0

parent 06a51f05
...@@ -1021,17 +1021,17 @@ function SelectDb($db,$sql){ ...@@ -1021,17 +1021,17 @@ function SelectDb($db,$sql){
} }
function Export($errcode=0,$errmsg='成功',$data=''){ function Export($errcode=0,$errmsg='成功',$data=''){
if(is_array($errcode)){ if(is_array($errcode)){
echo json_encode(['errcode'=>$errcode[0],'errmsg'=>$errcode[1],'data'=>!empty(@$errcode[2])?@$errcode[2]:''], JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES); echo json_encode(['code'=>$errcode[0],'msg'=>$errcode[1],'data'=>!empty(@$errcode[2])?@$errcode[2]:''], JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES);
}else{ }else{
echo json_encode(['errcode'=>$errcode,'errmsg'=>$errmsg,'data'=>$data], JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES); echo json_encode(['code'=>$errcode,'msg'=>$errmsg,'data'=>$data], JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES);
} }
exit(); exit();
} }
function ExportLayui($errcode=0,$errmsg=0,$data=[],$count=0,$other=''){ function ExportLayui($errcode=0,$errmsg=0,$data=[],$count=0,$other=''){
if(is_array($errcode)){ if(is_array($errcode)){
echo json_encode(['code'=>$errcode[0],'errmsg'=>$errcode[1],'data'=>@$errcode[2],'count'=>@$errcode[3],'other'=>!empty(@$errcode[4]) ? @$errcode[4] : ''], JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES); echo json_encode(['code'=>$errcode[0],'msg'=>$errcode[1],'data'=>@$errcode[2],'count'=>@$errcode[3],'other'=>!empty(@$errcode[4]) ? @$errcode[4] : ''], JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES);
}else{ }else{
echo json_encode(['errcode'=>$errcode,'errmsg'=>$errmsg,'data'=>$data,'count'=>$count,'other'=>$other], JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES); echo json_encode(['code'=>$errcode,'msg'=>$errmsg,'data'=>$data,'count'=>$count,'other'=>$other], JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES);
} }
exit(); exit();
} }
......
...@@ -96,13 +96,12 @@ class UploadChangePrice extends Job implements ShouldQueue ...@@ -96,13 +96,12 @@ class UploadChangePrice extends Job implements ShouldQueue
$res[2] .="商家商品编码不得为空\n"; $res[2] .="商家商品编码不得为空\n";
$Push=false; $Push=false;
} }
if(!$res['1']){
$res[2] .='价格不得为空'."\n";
$Push=false;
}
$datas[]=$res; $datas[]=$res;
} }
} }
#查询商品编码
if($Push===true){//验证通过 if($Push===true){//验证通过
$result=(new GoodsAuditModel())->BacthAdd($datas); $result=(new GoodsAuditModel())->BacthAdd($datas);
if($result){ if($result){
......
...@@ -33,11 +33,13 @@ class ServerFinanceModel ...@@ -33,11 +33,13 @@ class ServerFinanceModel
print_r($res); print_r($res);
die(); die();
} }
$p = json_decode($res,true);
$p['code'] = $p['errcode'];
unset($p['errcode']);
if ($type == 1){ if ($type == 1){
echo $res; echo json_encode($p);
exit();
}else{ }else{
return json_decode($res,true); return $p;
} }
} }
//获取对账单列表 //获取对账单列表
......
...@@ -33,11 +33,13 @@ class ServerPurModel ...@@ -33,11 +33,13 @@ class ServerPurModel
print_r($res); print_r($res);
die(); die();
} }
$p = json_decode($res,true);
$p['code'] = $p['errcode'];
unset($p['errcode']);
if ($type == 1){ if ($type == 1){
echo $res; echo json_encode($p);
exit();
}else{ }else{
return json_decode($res,true); return $p;
} }
} }
//获取库存变化列表 //获取库存变化列表
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
}, },
tableList:function (page) { tableList:function (page) {
var res = ajax_push(URL_YUNXIN + '/api/ApiAbnormalDetail',{'p':page,'abnormal_id':$("#abnormal_id").val()}) var res = ajax_push(URL_YUNXIN + '/api/ApiAbnormalDetail',{'p':page,'abnormal_id':$("#abnormal_id").val()})
if (res.errcode == 0) { if (res.code == 0) {
var other = res.other; var other = res.other;
$(".abnormal_sn").html(other.abnormal_sn); $(".abnormal_sn").html(other.abnormal_sn);
$(".create_time").html(other.create_time); $(".create_time").html(other.create_time);
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
}); });
} else { } else {
alert_err(res.errmsg) alert_err(res.msg)
return false; return false;
} }
} }
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
'create_time2':$("input[name='create_time2']").val(), 'create_time2':$("input[name='create_time2']").val(),
} }
var res = ajax_push(URL_YUNXIN + '/api/ApiAbnormalList',postData) var res = ajax_push(URL_YUNXIN + '/api/ApiAbnormalList',postData)
if (res.errcode == 0) { if (res.code == 0) {
var html = ""; var html = "";
if(res.data.length > 0) { if(res.data.length > 0) {
for (i = 0; i < res.data.length; i++) { for (i = 0; i < res.data.length; i++) {
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
} }
}); });
} else { } else {
alert_err(res.errmsg) alert_err(res.msg)
return false; return false;
} }
} }
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
$("#changeChecking").click(function () { $("#changeChecking").click(function () {
alert_confirm("确定对账完成?",function () { alert_confirm("确定对账完成?",function () {
var res = ajax_push("/api/ApiAccountChangeChecking",{"checking_id":$("#checking_id").val()}); var res = ajax_push("/api/ApiAccountChangeChecking",{"checking_id":$("#checking_id").val()});
res.errcode > 0 ? alert_err(res.errmsg) : alert_succ(res.errmsg,function () { res.code > 0 ? alert_err(res.msg) : alert_succ(res.msg,function () {
window.location.reload() window.location.reload()
}); });
}) })
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
}); });
} else { } else {
alert_err(res.errmsg) alert_err(res.msg)
return false; return false;
} }
} }
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
'create_time2':$("#create_time2").val(), 'create_time2':$("#create_time2").val(),
} }
var res = ajax_push(URL_YUNXIN + '/api/ApiAccountCheckingList',postData) var res = ajax_push(URL_YUNXIN + '/api/ApiAccountCheckingList',postData)
if (res.errcode == 0) { if (res.code == 0) {
var html = ""; var html = "";
if(res.data.length > 0) { if(res.data.length > 0) {
for (i = 0; i < res.data.length; i++) { for (i = 0; i < res.data.length; i++) {
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
} }
}); });
} else { } else {
alert_err(res.errmsg) alert_err(res.msg)
return false; return false;
} }
} }
......
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
return false; return false;
} }
var res = ajax_push('/api/ApiGoodsAuditExmine',{id:ids.join(','),'status':status}) var res = ajax_push('/api/ApiGoodsAuditExmine',{id:ids.join(','),'status':status})
res.errcode > 0 ? alert_err(res.errmsg) : alert_succ(res.errmsg,function () { res.code > 0 ? alert_err(res.msg) : alert_succ(res.msg,function () {
app.tableList(); app.tableList();
}) })
}) })
......
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
,exts:'csv' ,exts:'csv'
,done: function(res){ ,done: function(res){
if(!res) return layer.msg('网络连接失败,请重试',{icon:6}); if(!res) return layer.msg('网络连接失败,请重试',{icon:6});
return layer.msg(res.errmsg,{icon:6}); return layer.msg(res.msg,{icon:6});
} }
,error: function(){ ,error: function(){
return layer.msg('上传异常',{icon:5}); return layer.msg('上传异常',{icon:5});
......
...@@ -35,10 +35,10 @@ ...@@ -35,10 +35,10 @@
dataType: 'json', dataType: 'json',
timeout: 10000, timeout: 10000,
success: function (res) { success: function (res) {
if (res.errcode == 0) { if (res.code == 0) {
typeof callback == 'function' && callback(res); typeof callback == 'function' && callback(res);
} else { } else {
$(".error").show().text(res.errmsg); $(".error").show().text(res.msg);
return false; return false;
} }
}, },
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
}, },
tableList:function (page) { tableList:function (page) {
var res = ajax_push(URL_YUNXIN + '/api/ApiOrderDetail',{'p':page,'order_id':$("#order_id").val()}) var res = ajax_push(URL_YUNXIN + '/api/ApiOrderDetail',{'p':page,'order_id':$("#order_id").val()})
if (res.errcode == 0) { if (res.code == 0) {
var other = res.other; var other = res.other;
$(".order_sn").html(other.order_sn); $(".order_sn").html(other.order_sn);
$(".putaway_time").html(other.putaway_time); $(".putaway_time").html(other.putaway_time);
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
}); });
} else { } else {
alert_err(res.errmsg) alert_err(res.msg)
return false; return false;
} }
} }
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
'create_time2':$("input[name='create_time2']").val(), 'create_time2':$("input[name='create_time2']").val(),
} }
var res = ajax_push(URL_YUNXIN + '/api/ApiOrderList',postData) var res = ajax_push(URL_YUNXIN + '/api/ApiOrderList',postData)
if (res.errcode == 0) { if (res.code == 0) {
var html = ""; var html = "";
if(res.data.length > 0) { if(res.data.length > 0) {
for (i = 0; i < res.data.length; i++) { for (i = 0; i < res.data.length; i++) {
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
} }
}); });
} else { } else {
alert_err(res.errmsg) alert_err(res.msg)
return false; 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