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)
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
{
// 首页
......@@ -211,7 +260,7 @@ Class OrderController extends Controller
$data['k2'] = md5(md5($data['k1']).'fh6y5t4rr351d2c3bryi');
$data['p'] = $request->input('p', 1); // 当前页码
$data['map'] = $map;
// dd(curlApi($url, $data));
$response = json_decode(curlApi($url, $data), true);
// 分页
......@@ -222,7 +271,7 @@ Class OrderController extends Controller
$info['condition'] = $map;
$info['sale_list'] = $sale_list;
$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['page'] = $show;
......@@ -265,7 +314,7 @@ Class OrderController extends Controller
$data['k2'] = md5(md5($data['k1']).'fh6y5t4rr351d2c3bryi');
$data['p'] = $request->input('p', 1); // 当前页码
$data['map'] = $map;
// dd(curlApi($url, $data));
$response = json_decode(curlApi($url, $data), true);
// 分页
......@@ -276,7 +325,7 @@ Class OrderController extends Controller
$info['condition'] = $map;
$info['sale_list'] = $sale_list;
$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['page'] = $show;
......
......@@ -140,7 +140,7 @@
}
?>
</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">
<?php
......@@ -153,18 +153,9 @@
</td>
<td class="show-list" class="show-list">
<?php
if (!empty($v['shipping_type'])) {
$pos = strpos($v['shipping_type'], '1'); // 订单物流1
if ($pos !== false) {
$exp = explode(',', $v['shipping_status']);
if (count($exp) == 1) {
$status = $exp[0];
} else {
$status = $exp[$pos];
}
$status = App\Http\Controllers\getShipping($v['order_id']);
if ($status) {
switch ($status) {
case 1: echo '已配送'; break;
case 2: echo '已签收'; break;
......@@ -173,9 +164,6 @@
} else {
echo '';
}
} else {
echo '';
}
?>
</td>
<td class="show-list">
......@@ -208,7 +196,9 @@
<td class="table-list-title">订单编号</td>
<td class="table-list-content">{{$v['order_sn']}}</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>
@if ($v['order_pay_type'] == 2)
<tr>
......@@ -263,10 +253,7 @@
</div>
<div class="row-fluid pagination">
<span>
共{{$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}}
共{{$count ? $count : 0}}单
</span>
<?php echo $page; ?>
......
......@@ -209,7 +209,7 @@
}
?>
</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">
<?php
......@@ -222,18 +222,9 @@
</td>
<td class="show-list" class="show-list">
<?php
if (!empty($v['shipping_type'])) {
$pos = strpos($v['shipping_type'], '1'); // 订单物流1
if ($pos !== false) {
$exp = explode(',', $v['shipping_status']);
if (count($exp) == 1) {
$status = $exp[0];
} else {
$status = $exp[$pos];
}
$status = App\Http\Controllers\getShipping($v['order_id']);
if ($status) {
switch ($status) {
case 1: echo '已配送'; break;
case 2: echo '已签收'; break;
......@@ -242,9 +233,6 @@
} else {
echo '';
}
} else {
echo '';
}
?>
</td>
<td class="show-list">
......@@ -276,7 +264,7 @@
<td class="table-list-content">{{$v['order_sn']}}</td>
<td class="table-list-title">公司名称</td>
<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>
</tr>
@if ($v['order_pay_type'] == 2)
......@@ -332,10 +320,7 @@
</div>
<div class="row-fluid pagination">
<span>
共{{$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}}
共{{$count ? $count : 0}}单
</span>
<?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