diff --git a/app/admin/controller/user_product_storage/UserProductStorageController.php b/app/admin/controller/user_product_storage/UserProductStorageController.php new file mode 100644 index 000000000..3b428e3bd --- /dev/null +++ b/app/admin/controller/user_product_storage/UserProductStorageController.php @@ -0,0 +1,30 @@ +dataLists(new UserProductStorageLists()); + } + +} \ No newline at end of file diff --git a/app/admin/controller/user_product_storage_log/UserProductStorageLogController.php b/app/admin/controller/user_product_storage_log/UserProductStorageLogController.php new file mode 100644 index 000000000..45365f762 --- /dev/null +++ b/app/admin/controller/user_product_storage_log/UserProductStorageLogController.php @@ -0,0 +1,32 @@ +dataLists(new UserProductStorageLogLists()); + } + +} \ No newline at end of file diff --git a/app/admin/lists/store_order/StoreRefundOrderLists.php b/app/admin/lists/store_order/StoreRefundOrderLists.php index efa8f82d9..8aff1b11d 100644 --- a/app/admin/lists/store_order/StoreRefundOrderLists.php +++ b/app/admin/lists/store_order/StoreRefundOrderLists.php @@ -6,6 +6,7 @@ use app\admin\lists\BaseAdminDataLists; use app\common\enum\OrderEnum; use app\common\lists\ListsSearchInterface; use app\common\model\store_order\StoreOrder; +use app\common\model\user\User; class StoreRefundOrderLists extends BaseAdminDataLists implements ListsSearchInterface { @@ -38,7 +39,7 @@ class StoreRefundOrderLists extends BaseAdminDataLists implements ListsSearchInt public function lists(): array { $this->searchWhere[] = ['refund_status','>', 0]; - return StoreOrder::with(['user', 'staff', 'product' => function ($query) { + return StoreOrder::with(['staff', 'product' => function ($query) { $query->field(['id', 'oid', 'product_id', 'cart_info']); }]) ->where($this->searchWhere) @@ -46,6 +47,15 @@ class StoreRefundOrderLists extends BaseAdminDataLists implements ListsSearchInt ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc']) ->select()->each(function ($item) { + 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; + } + } $item['pay_time'] = $item['pay_time'] > 0 ? date('Y-m-d H:i:s', $item['pay_time']) : ''; $item['refund_status_name'] = OrderEnum::refundStatus($item['refund_status']) ?? ''; $item['refund_type_name'] = OrderEnum::refundType($item['refund_type']) ?? ''; diff --git a/app/admin/lists/user_product_storage/UserProductStorageLists.php b/app/admin/lists/user_product_storage/UserProductStorageLists.php new file mode 100644 index 000000000..fdac3935e --- /dev/null +++ b/app/admin/lists/user_product_storage/UserProductStorageLists.php @@ -0,0 +1,72 @@ + ['uid', 'oid', 'product_id'], + 'between_time' => ['create_time'], + ]; + } + + + /** + * @notes 获取用户商品储存列表 + * @return array + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException + * @author admin + * @date 2024/06/28 11:05 + */ + public function lists(): array + { + return UserProductStorage::where($this->searchWhere) + ->field(['id', 'uid', 'oid', 'product_id', 'nums', 'status','create_time']) + ->limit($this->limitOffset, $this->limitLength) + ->order(['id' => 'desc']) + ->select()->each(function($item){ + $user=User::where('id',$item['uid'])->field('nickname,real_name')->find(); + $item['nickname']=$user['real_name']?$user['real_name'].'|'.$item['uid']:$user['nickname'].'|'.$item['uid']; + $item['store_name']=StoreProduct::where('id',$item['product_id'])->value('store_name'); + return $item; + }) + ->toArray(); + } + + + /** + * @notes 获取用户商品储存数量 + * @return int + * @author admin + * @date 2024/06/28 11:05 + */ + public function count(): int + { + return UserProductStorage::where($this->searchWhere)->count(); + } + +} \ No newline at end of file diff --git a/app/admin/lists/user_product_storage_log/UserProductStorageLogLists.php b/app/admin/lists/user_product_storage_log/UserProductStorageLogLists.php new file mode 100644 index 000000000..25b9c9d08 --- /dev/null +++ b/app/admin/lists/user_product_storage_log/UserProductStorageLogLists.php @@ -0,0 +1,78 @@ + ['create_time'], + ]; + } + + + /** + * @notes 获取用户商品储存操作日志列表 + * @return array + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException + * @author admin + * @date 2024/06/28 11:15 + */ + public function lists(): array + { + return UserProductStorageLog::where($this->searchWhere) + ->field(['id', 'oid', 'uid', 'product_id', 'store_id', 'financial_pm', 'nums']) + ->limit($this->limitOffset, $this->limitLength) + ->order(['id' => 'desc']) + ->select()->each(function($item){ + $user=User::where('id',$item['uid'])->field('nickname,real_name')->find(); + $item['system_store_name']=SystemStore::where('id',$item['store_id'])->value('name'); + $item['nickname']=$user['real_name']?$user['real_name'].'|'.$item['uid']:$user['nickname'].'|'.$item['uid']; + $item['store_name']=StoreProduct::where('id',$item['product_id'])->value('store_name'); + if($item['financial_pm']==1){ + $item['financial_pm']='增加'; + }else{ + $item['financial_pm']='减少'; + } + return $item; + }) + ->toArray(); + } + + + /** + * @notes 获取用户商品储存操作日志数量 + * @return int + * @author admin + * @date 2024/06/28 11:15 + */ + public function count(): int + { + return UserProductStorageLog::where($this->searchWhere)->count(); + } + +} \ No newline at end of file diff --git a/app/admin/lists/user_recharge/UserRechargeLists.php b/app/admin/lists/user_recharge/UserRechargeLists.php index a6f1f432e..096a193f4 100644 --- a/app/admin/lists/user_recharge/UserRechargeLists.php +++ b/app/admin/lists/user_recharge/UserRechargeLists.php @@ -48,7 +48,11 @@ class UserRechargeLists extends BaseAdminDataLists implements ListsSearchInterfa ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc']) ->select()->each(function ($item) { - $item['nickname']=User::where('id',$item['uid'])->value('nickname'); + $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['pay_time']>0){ $item['pay_time']=date('Y-m-d H:i:s',$item['pay_time']); }else{