master
wangxinglong 2022-06-10 10:18:24 +08:00
parent de31878b8d
commit 877dbb24fe
5 changed files with 27 additions and 6 deletions

View File

@ -101,6 +101,7 @@ class Order extends Base
$isScore = $searchParams['is_score'] ?? 0;
$whereMap = [];
$userWhereMap = [];
$order = ['id' => 'desc'];
$whereMap[] = ['is_score', '=', $isScore];
@ -130,9 +131,19 @@ class Order extends Base
if (isset($searchParams['phone']) && !empty($searchParams['phone'])) {
$whereMap[] = ['phone', 'like', "%".$searchParams['phone']."%"];
}
if (isset($searchParams['nickname']) && !empty($searchParams['nickname'])) {
$userWhereMap[] = ['nickname', 'like', "%".$searchParams['nickname']."%"];
}
$res = OrderModel::findList($whereMap, [], $page, $size, function ($q) {
return $q->with(['account']);
$res = OrderModel::findList($whereMap, [], $page, $size, function ($q)use($userWhereMap) {
if (!empty($userWhereMap)) {
return $q->hasWhere('account', function ($query) use ($userWhereMap) {
$query->where($userWhereMap);
});
} else {
return $q->with(['account']);
}
}, $order);
$res['list'] = $res['list']->each(function ($item) {

View File

@ -135,6 +135,11 @@ layui.use(['laytpl', 'table', 'jquery', 'form', 'miniTab', 'xmSelect', 'laydate'
// {field: 'paid_at', title: '支付时间', width: 180, hide: true},
{field: 'status_text', title: '订单状态', minWidth: 100},
{field: 'contacts', title: '联系人',minWidth: 150},
{templet: function (d) {
if(d.account!==undefined){
return d.account.nickname;
}
}, title: '微信号',minWidth: 150},
{field: 'phone',title: '电话',minWidth: 150},
// {field: 'pick_self_text', title: '配送方式',minWidth: 150},
// {field: 'is_score_text', title: '积分订单', minWidth: 150},

View File

@ -54,6 +54,14 @@
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">微信昵称</label>
<div class="layui-input-block">
<input type="text" class="layui-input" name="nickname" value="">
</div>
</div>
<div class="layui-inline">
<label class="layui-form-label">联系人</label>
<div class="layui-input-block">

View File

@ -16,10 +16,7 @@
<td>订单状态:{$statusList[$item['status']] ?? ''}</td>
</tr>
<tr>
<td>应付总价(元):
<div class="layui-input-inline">
<input id="order_original_price" type="text" class="layui-input " name="item[original_price]" value="{$item.original_price ?? ''}">
</div>
<td>应付总价(元):{$item.original_price ?? ''}
</td>
<td>下单时间:{$item.created_at ?? ''}</td>
<!-- <td>实付总价(元):{$item.price ?? 0}</td>-->