feat: 增加用户真实姓名显示功能
This commit is contained in:
parent
149afec11f
commit
7b5a2e76d4
@ -67,7 +67,10 @@ class StoreFinanceFlowLists extends BaseAdminDataLists implements ListsSearchInt
|
|||||||
$item['nickname'] = '游客';
|
$item['nickname'] = '游客';
|
||||||
} else {
|
} else {
|
||||||
$id = $item['user_id'];
|
$id = $item['user_id'];
|
||||||
$item['nickname'] = User::where('id', $item['user_id'])->value('nickname') . "|$id";
|
$user=User::where('id', $item['user_id'])->field('real_name,nickname')->find();
|
||||||
|
if($user){
|
||||||
|
$item['nickname'] =$user['real_name']!=''?$user['real_name']:$user['nickname'].'|'.$id;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!empty($this->request->adminInfo['store_id'])) {
|
if (!empty($this->request->adminInfo['store_id'])) {
|
||||||
$item['financial_pm'] = $item['financial_pm'] == 0 ? 1 : 0;
|
$item['financial_pm'] = $item['financial_pm'] == 0 ? 1 : 0;
|
||||||
|
@ -10,6 +10,7 @@ use app\common\model\store_order\StoreOrder;
|
|||||||
use app\common\lists\ListsSearchInterface;
|
use app\common\lists\ListsSearchInterface;
|
||||||
use app\common\model\store_branch_product\StoreBranchProduct;
|
use app\common\model\store_branch_product\StoreBranchProduct;
|
||||||
use app\common\model\store_order_cart_info\StoreOrderCartInfo;
|
use app\common\model\store_order_cart_info\StoreOrderCartInfo;
|
||||||
|
use app\common\model\user\User;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 订单列表列表
|
* 订单列表列表
|
||||||
@ -46,7 +47,7 @@ class StoreOrderLists extends BaseAdminDataLists implements ListsSearchInterface
|
|||||||
*/
|
*/
|
||||||
public function lists(): array
|
public function lists(): array
|
||||||
{
|
{
|
||||||
return StoreOrder::with(['user', 'staff'])->where($this->searchWhere)
|
return StoreOrder::with(['staff'])->where($this->searchWhere)
|
||||||
->when(!empty($this->request->adminInfo['store_id']), function ($query) {
|
->when(!empty($this->request->adminInfo['store_id']), function ($query) {
|
||||||
$query->where('store_id', $this->request->adminInfo['store_id']);
|
$query->where('store_id', $this->request->adminInfo['store_id']);
|
||||||
})
|
})
|
||||||
@ -64,6 +65,15 @@ class StoreOrderLists extends BaseAdminDataLists implements ListsSearchInterface
|
|||||||
->select()->each(function ($item) {
|
->select()->each(function ($item) {
|
||||||
$item['pay_time'] = $item['pay_time'] > 0 ? date('Y-m-d H:i:s', $item['pay_time']) : '';
|
$item['pay_time'] = $item['pay_time'] > 0 ? date('Y-m-d H:i:s', $item['pay_time']) : '';
|
||||||
$item['status_name'] = OrderEnum::getOrderType($item['status']) ?? '';
|
$item['status_name'] = OrderEnum::getOrderType($item['status']) ?? '';
|
||||||
|
if ($item['uid'] <= 0) {
|
||||||
|
$item['nickname'] = '游客';
|
||||||
|
} else {
|
||||||
|
$id = $item['uid'];
|
||||||
|
$user=User::where('id', $item['uid'])->field('real_name,nickname')->find();
|
||||||
|
if($user){
|
||||||
|
$item['nickname'] =$user['real_name']!=''?$user['real_name'].'|'.$id:$user['nickname'].'|'.$id;
|
||||||
|
}
|
||||||
|
}
|
||||||
if ($item['paid'] == 0) {
|
if ($item['paid'] == 0) {
|
||||||
$item['status_name'] = '待支付';
|
$item['status_name'] = '待支付';
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user