12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- <?php
- namespace app\services\cashier;
- use app\services\BaseServices;
- use app\services\order\StoreCartServices;
- class OrderServices extends BaseServices
- {
-
- public function getOrderUserList(int $storeId, int $cashierId = 0)
- {
-
- $cartServices = app()->make(StoreCartServices::class);
- $list1 = $cartServices->getHangOrder($storeId, $cashierId)->order('add_time desc')->select()->toArray();
- foreach ($list1 as &$item) {
- $item['is_check'] = 0;
- }
- $uids = [];
- if ($list1){
- $uids = array_unique(array_column($list1, 'uid'));
- }
- $list2 = [];
- [$microsecond, $sec] = explode(" ", microtime());
- $touristUid = round($microsecond * 10000);
- $list0 = [[
- 'is_check' => 1,
- 'tourist_uid' => $touristUid,
- 'uid' => 0,
- 'nickname' => '',
- 'avatar' => '',
- 'staff_id' => $cashierId,
- 'store_id' => $storeId,
- 'cart_id' => '',
- 'add_time' => time()
- ]];
- return array_merge($list0, $list1, $list2);
- }
- }
|