Commit 82366cc8 by 朱继来

Merge branch 'zjl_hide_sendbtn_0301' into 'master'

调整订单列表

See merge request !12
parents a59169c0 5c7ad20f
...@@ -86,6 +86,55 @@ function getCoupon($order_id) ...@@ -86,6 +86,55 @@ function getCoupon($order_id)
return null; return null;
} }
function getPayName($order_id)
{
$payLog = DB::connection('order')
->table('lie_pay_log')
->where(['order_id' => $order_id])
->select('pay_name')
->get();
if (!empty($payLog)) {
foreach ($payLog as $v) {
$payName[] = $v->pay_name;
}
return implode(',', $payName);
}
return false;
}
function getShipping($order_id)
{
$shipping = DB::connection('order')
->table('lie_order_shipping')
->where(['order_id' => $order_id, 'shipping_type' => 1])
->select('status')
->first();
if (!empty($shipping)) {
return $shipping->status;
}
return false;
}
function getCompanyName($user_id)
{
$company = DB::connection('order')
->table('lie_user_company')
->where(['user_id' => $user_id])
->select('com_name')
->first();
if (!empty($company)) {
return $company->com_name;
}
return false;
}
Class OrderController extends Controller Class OrderController extends Controller
{ {
// 首页 // 首页
...@@ -211,7 +260,7 @@ Class OrderController extends Controller ...@@ -211,7 +260,7 @@ Class OrderController extends Controller
$data['k2'] = md5(md5($data['k1']).'fh6y5t4rr351d2c3bryi'); $data['k2'] = md5(md5($data['k1']).'fh6y5t4rr351d2c3bryi');
$data['p'] = $request->input('p', 1); // 当前页码 $data['p'] = $request->input('p', 1); // 当前页码
$data['map'] = $map; $data['map'] = $map;
// dd(curlApi($url, $data));
$response = json_decode(curlApi($url, $data), true); $response = json_decode(curlApi($url, $data), true);
// 分页 // 分页
...@@ -222,7 +271,7 @@ Class OrderController extends Controller ...@@ -222,7 +271,7 @@ Class OrderController extends Controller
$info['condition'] = $map; $info['condition'] = $map;
$info['sale_list'] = $sale_list; $info['sale_list'] = $sale_list;
$info['list'] = $response['data']['data']; $info['list'] = $response['data']['data'];
$info['pay_count'] = $response['data']['pay_count']; // $info['pay_count'] = $response['data']['pay_count'];
$info['count'] = $response['data']['count']; $info['count'] = $response['data']['count'];
$info['page'] = $show; $info['page'] = $show;
...@@ -265,7 +314,7 @@ Class OrderController extends Controller ...@@ -265,7 +314,7 @@ Class OrderController extends Controller
$data['k2'] = md5(md5($data['k1']).'fh6y5t4rr351d2c3bryi'); $data['k2'] = md5(md5($data['k1']).'fh6y5t4rr351d2c3bryi');
$data['p'] = $request->input('p', 1); // 当前页码 $data['p'] = $request->input('p', 1); // 当前页码
$data['map'] = $map; $data['map'] = $map;
// dd(curlApi($url, $data));
$response = json_decode(curlApi($url, $data), true); $response = json_decode(curlApi($url, $data), true);
// 分页 // 分页
...@@ -276,7 +325,7 @@ Class OrderController extends Controller ...@@ -276,7 +325,7 @@ Class OrderController extends Controller
$info['condition'] = $map; $info['condition'] = $map;
$info['sale_list'] = $sale_list; $info['sale_list'] = $sale_list;
$info['list'] = $response['data']['data']; $info['list'] = $response['data']['data'];
$info['pay_count'] = $response['data']['pay_count']; // $info['pay_count'] = $response['data']['pay_count'];
$info['count'] = $response['data']['count']; $info['count'] = $response['data']['count'];
$info['page'] = $show; $info['page'] = $show;
......
...@@ -140,7 +140,7 @@ ...@@ -140,7 +140,7 @@
} }
?> ?>
</td> </td>
<td class="show-list">{{$v['pay_name']}}</td> <td class="show-list"><?php print_r(App\Http\Controllers\getPayName($v['order_id'])); ?></td>
<td class="show-list"> <td class="show-list">
<?php <?php
...@@ -153,30 +153,18 @@ ...@@ -153,30 +153,18 @@
</td> </td>
<td class="show-list" class="show-list"> <td class="show-list" class="show-list">
<?php <?php
if (!empty($v['shipping_type'])) { $status = App\Http\Controllers\getShipping($v['order_id']);
$pos = strpos($v['shipping_type'], '1'); // 订单物流1
if ($pos !== false) { if ($status) {
$exp = explode(',', $v['shipping_status']); switch ($status) {
case 1: echo '已配送'; break;
if (count($exp) == 1) { case 2: echo '已签收'; break;
$status = $exp[0]; default: echo '未配送'; break;
} else { }
$status = $exp[$pos];
}
switch ($status) {
case 1: echo '已配送'; break;
case 2: echo '已签收'; break;
default: echo '未配送'; break;
}
} else {
echo '';
}
} else { } else {
echo ''; echo '';
} }
?> ?>
</td> </td>
<td class="show-list"> <td class="show-list">
@if ($v['order_shipping_type'] == '1') @if ($v['order_shipping_type'] == '1')
...@@ -208,7 +196,9 @@ ...@@ -208,7 +196,9 @@
<td class="table-list-title">订单编号</td> <td class="table-list-title">订单编号</td>
<td class="table-list-content">{{$v['order_sn']}}</td> <td class="table-list-content">{{$v['order_sn']}}</td>
<td class="table-list-title">公司名称</td> <td class="table-list-title">公司名称</td>
<td class="table-list-content">{{$v['com_name']}}</td> <td class="table-list-content">
<p class="show-title" title="{{App\Http\Controllers\getCompanyName($v['user_id'])}}">{{App\Http\Controllers\getCompanyName($v['user_id'])}}</p>
</td>
</tr> </tr>
@if ($v['order_pay_type'] == 2) @if ($v['order_pay_type'] == 2)
<tr> <tr>
...@@ -263,10 +253,7 @@ ...@@ -263,10 +253,7 @@
</div> </div>
<div class="row-fluid pagination"> <div class="row-fluid pagination">
<span> <span>
共{{$count ? $count : 0}}单, 共{{$count ? $count : 0}}单
应付金额 ¥{{$pay_count['rmb_count'] ? $pay_count['rmb_count'] : 0}}, ${{$pay_count['usd_count'] ? $pay_count['usd_count'] : 0}},
实收金额 ¥{{$pay_count['rmb_pay'] ? $pay_count['rmb_pay'] : 0}},
${{$pay_count['usd_pay'] ? $pay_count['usd_pay'] : 0}}
</span> </span>
<?php echo $page; ?> <?php echo $page; ?>
......
...@@ -209,7 +209,7 @@ ...@@ -209,7 +209,7 @@
} }
?> ?>
</td> </td>
<td class="show-list">{{$v['pay_name']}}</td> <td class="show-list"><?php print_r(App\Http\Controllers\getPayName($v['order_id'])); ?></td>
<td class="show-list"> <td class="show-list">
<?php <?php
...@@ -222,29 +222,17 @@ ...@@ -222,29 +222,17 @@
</td> </td>
<td class="show-list" class="show-list"> <td class="show-list" class="show-list">
<?php <?php
if (!empty($v['shipping_type'])) { $status = App\Http\Controllers\getShipping($v['order_id']);
$pos = strpos($v['shipping_type'], '1'); // 订单物流1
if ($pos !== false) { if ($status) {
$exp = explode(',', $v['shipping_status']); switch ($status) {
case 1: echo '已配送'; break;
if (count($exp) == 1) { case 2: echo '已签收'; break;
$status = $exp[0]; default: echo '未配送'; break;
} else { }
$status = $exp[$pos];
}
switch ($status) {
case 1: echo '已配送'; break;
case 2: echo '已签收'; break;
default: echo '未配送'; break;
}
} else {
echo '';
}
} else { } else {
echo ''; echo '';
} }
?> ?>
</td> </td>
<td class="show-list"> <td class="show-list">
...@@ -276,7 +264,7 @@ ...@@ -276,7 +264,7 @@
<td class="table-list-content">{{$v['order_sn']}}</td> <td class="table-list-content">{{$v['order_sn']}}</td>
<td class="table-list-title">公司名称</td> <td class="table-list-title">公司名称</td>
<td class="table-list-content"> <td class="table-list-content">
<p class="show-title" title="{{$v['com_name']}}">{{$v['com_name']}}</p> <p class="show-title" title="{{App\Http\Controllers\getCompanyName($v['user_id'])}}">{{App\Http\Controllers\getCompanyName($v['user_id'])}}</p>
</td> </td>
</tr> </tr>
@if ($v['order_pay_type'] == 2) @if ($v['order_pay_type'] == 2)
...@@ -332,10 +320,7 @@ ...@@ -332,10 +320,7 @@
</div> </div>
<div class="row-fluid pagination"> <div class="row-fluid pagination">
<span> <span>
共{{$count ? $count : 0}}单, 共{{$count ? $count : 0}}单
应付金额 ¥{{$pay_count['rmb_count'] ? $pay_count['rmb_count'] : 0}}, ${{$pay_count['usd_count'] ? $pay_count['usd_count'] : 0}},
实收金额 ¥{{$pay_count['rmb_pay'] ? $pay_count['rmb_pay'] : 0}},
${{$pay_count['usd_pay'] ? $pay_count['usd_pay'] : 0}}
</span> </span>
<?php echo $page; ?> <?php echo $page; ?>
......
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