Commit 576af68a by 朱继来

Merge branch 'zjl_erp_syn_20190514' into development

parents 8459b6c6 7da44015
......@@ -176,11 +176,7 @@ Class AddOrderController extends Controller
$url = Config('website.api_domain').'ucoupon/bestusebyordersystem';
$res = curlApi($url, $data);
if (!$res) return ['errcode'=>1, 'errmsg'=>'未访问到API接口,请重新尝试'];
$response = json_decode($res, true);
$response = json_decode(curlApi($url, $data), true);
if ($response['err_code'] == 0) {
return ['errcode' => $response['err_code'], 'errmsg' => $response['err_msg'], 'data'=>$response['data']];
......@@ -248,11 +244,7 @@ Class AddOrderController extends Controller
$data['k1'] = time();
$data['k2'] = md5(md5($data['k1']).'fh6y5t4rr351d2c3bryi');
$res = curlApi($url, $data, 'POST');
if (!$res) return ['errcode'=>1, 'errmsg'=>'未访问到API接口,请重新尝试'];
$response = json_decode($res, true);
$response = json_decode(curlApi($url, $data, 'POST'), true);
if (!empty($response['data'])) {
return ['errcode' => 0, 'errmsg' => '', 'data' => $response['data']];
......@@ -279,11 +271,7 @@ Class AddOrderController extends Controller
$url = Config('website.api_domain').'cart/addByOrderSystem';
$res = curlApi($url, $data);
if (!$res) return ['errcode'=>1, 'errmsg'=>'未访问到API接口,请重新尝试'];
$response = json_decode($res, true);
$response = json_decode(curlApi($url, $data), true);
if ($response['err_code'] == 0) {
return ['errcode' => $response['err_code'], 'errmsg' => $response['err_msg'], 'data'=>$response['data']];
......@@ -305,11 +293,7 @@ Class AddOrderController extends Controller
$url = Config('website.api_domain').'cart/switchSaleType';
$res = curlApi($url, $data);
if (!$res) return ['errcode'=>1, 'errmsg'=>'未访问到API接口,请重新尝试'];
$response = json_decode($res, true);
$response = json_decode(curlApi($url, $data), true);
return ['errcode' => $response['err_code'], 'errmsg' => $response['err_msg']];
}
......@@ -328,11 +312,7 @@ Class AddOrderController extends Controller
$url = Config('website.api_domain').'cart/listsByOrderSystem';
$res = curlApi($url, $data);
if (!$res) return ['errcode'=>1, 'errmsg'=>'未访问到API接口,请重新尝试'];
$response = json_decode($res, true);
$response = json_decode(curlApi($url, $data), true);
if ($response['err_code'] == 0) {
return ['errcode' => $response['err_code'], 'errmsg' => $response['err_msg'], 'data'=>$response['data']];
......@@ -361,11 +341,7 @@ Class AddOrderController extends Controller
$url = Config('website.api_domain').'cart/changeNumByOrderSystem';
}
$res = curlApi($url, $data);
if (!$res) return ['errcode'=>1, 'errmsg'=>'未访问到API接口,请重新尝试'];
$response = json_decode($res, true);
$response = json_decode(curlApi($url, $data), true);
if ($response['err_code'] == 0) {
return ['errcode' => $response['err_code'], 'errmsg' => $response['err_msg'], 'data'=>$response['data']];
......@@ -387,11 +363,7 @@ Class AddOrderController extends Controller
$url = Config('website.api_domain').'cart/deleteByOrderSystem';
$res = curlApi($url, $data);
if (!$res) return ['errcode'=>1, 'errmsg'=>'未访问到API接口,请重新尝试'];
$response = json_decode($res, true);
$response = json_decode(curlApi($url, $data), true);
if ($response['err_code'] == 0) {
return ['errcode' => $response['err_code'], 'errmsg' => $response['err_msg'], 'data'=>$response['data']];
......@@ -424,11 +396,7 @@ Class AddOrderController extends Controller
$url = Config('website.api_domain').'cart/confirm';
$res = curlApi($url, $data);
if (!$res) return ['errcode'=>1, 'errmsg'=>'未访问到API接口,请重新尝试'];
$response = json_decode($res, true);
$response = json_decode(curlApi($url, $data), true);
if ($response['err_code'] == 0) {
return ['errcode' => $response['err_code'], 'errmsg' => $response['err_msg'], 'data'=>$response['data']];
......@@ -518,11 +486,7 @@ Class AddOrderController extends Controller
$url = Config('website.api_domain').'order/create';
$res = curlApi($url, $data);
if (!$res) return ['errcode'=>1, 'errmsg'=>'未访问到API接口,请重新尝试'];
$response = json_decode($res, true);
$response = json_decode(curlApi($url, $data), true);
if ($response['err_code'] == 0) {
return ['errcode' => $response['err_code'], 'errmsg' => $response['err_msg'], 'data'=>['order_id' => $response['data'], 'type' => $data['type']]];
......
......@@ -1557,11 +1557,7 @@ Class OrderController extends Controller
$data['k1'] = time();
$data['k2'] = md5(md5($data['k1']).'fh6y5t4rr351d2c3bryi');
$res = curlApi($url, $data, "POST");
if (!$res) return ['errcode'=>1, 'errmsg'=>'未访问到API接口,请重新尝试'];
$temp = json_decode($res, true); // 连接API
$temp = json_decode(curlApi($url, $data, "POST"), true); // 连接API
if ($temp['err_code'] != 0) {
return ['errcode'=>$temp['err_code'], 'errmsg'=>$temp['err_msg']];
......
......@@ -288,13 +288,7 @@
<td class="show-list">
<?php
if ($v['order_pay_type'] == 3) { // 账期订单待付款状态下显示未同步
$statusLimit = [-1, 1];
} else {
$statusLimit = [-1, 1, 2];
}
if (in_array($v['status'], $statusLimit)) {
if (in_array($v['status'], [-1, 1])) {
echo '不需同步';
} else {
echo $v['erp_order_id'] != '' && $v['erp_order_id'] != '-' ? '<span class="list-text-success"><b>已同步</b></span>' : '<span class="list-text-checking"><b>未同步</b></span>';
......
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