Commit 576af68a by 朱继来

Merge branch 'zjl_erp_syn_20190514' into development

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