diff --git a/README.md b/README.md index 34c8bd47..4601ee87 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,5 @@ -# webman -High performance HTTP Service Framework for PHP based on [Workerman](https://github.com/walkor/workerman). - -# Manual (文档) - -https://www.workerman.net/doc/webman - -# Home page (主页) -https://www.workerman.net/webman - - -# Benchmarks (压测) - -https://www.techempower.com/benchmarks/#section=test&runid=9716e3cd-9e53-433c-b6c5-d2c48c9593c1&hw=ph&test=db&l=zg24n3-1r&a=2 -![image](https://user-images.githubusercontent.com/6073368/96447814-120fc980-1245-11eb-938d-6ea408716c72.png) - -## LICENSE - -MIT +source + 0 小程序 + 1 收银台 + 4 批发 \ No newline at end of file diff --git a/app/admin/lists/store_order/StoreOrderLists.php b/app/admin/lists/store_order/StoreOrderLists.php index 2ab7640c..aa1db8e6 100644 --- a/app/admin/lists/store_order/StoreOrderLists.php +++ b/app/admin/lists/store_order/StoreOrderLists.php @@ -31,7 +31,7 @@ class StoreOrderLists extends BaseAdminDataLists implements ListsSearchInterface public function setSearch(): array { return [ - '=' => ['order_id','store_id', 'pay_type', 'staff_id', 'shipping_type', 'delivery_id','paid', 'status', 'is_writeoff','is_merge','uid'], + '=' => ['order_id','store_id', 'pay_type', 'staff_id', 'shipping_type', 'delivery_id','paid', 'status', 'is_writeoff','is_merge','uid','source'], 'between_time' => 'create_time' ]; } @@ -63,7 +63,7 @@ class StoreOrderLists extends BaseAdminDataLists implements ListsSearchInterface $query->whereIn('status', $status); } }) - ->field(['id', 'store_id', 'staff_id', 'order_id', 'paid', 'pay_price','total_price', 'pay_time', 'pay_type', 'status', 'uid','refund_status','create_time','delivery_name','delivery_id','refund_price']) + ->field(['id', 'store_id', 'staff_id', 'order_id', 'paid','source', 'pay_price','total_price', 'pay_time', 'pay_type', 'status', 'uid','refund_status','create_time','delivery_name','delivery_id','refund_price']) ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc']) ->select()->each(function ($item) { @@ -85,6 +85,11 @@ class StoreOrderLists extends BaseAdminDataLists implements ListsSearchInterface if ($item['paid'] == 0) { $item['status_name'] = '待支付'; } + if($item['source']==4){ + $item['source_name'] = '批发订单'; + }else{ + $item['source_name'] = '普通订单'; + } $product = StoreOrderCartInfo::where('oid', $item['id'])->field(['id', 'oid', 'product_id', 'cart_info']) ->limit(3)->select(); foreach ($product as &$items) { diff --git a/app/admin/lists/store_order_cart_info/StoreOrderCartInfoLists.php b/app/admin/lists/store_order_cart_info/StoreOrderCartInfoLists.php index 2c712c04..e5026895 100644 --- a/app/admin/lists/store_order_cart_info/StoreOrderCartInfoLists.php +++ b/app/admin/lists/store_order_cart_info/StoreOrderCartInfoLists.php @@ -54,20 +54,19 @@ class StoreOrderCartInfoLists extends BaseAdminDataLists implements ListsSearchI ->field('id,oid,uid,product_id,store_id,cart_num,price,total_price,create_time')->limit($this->limitOffset, $this->limitLength) ->select()->each(function ($item) { $find=StoreProduct::where('id',$item['product_id'])->field('image,unit,store_name,store_info')->find(); + $item['nickname']='无'; + $item['mobile']=''; if($find){ if($item['uid']>0){ $user=User::where('id',$item['uid'])->field('real_name,mobile')->find(); if($user){ + $item['mobile']=$user['mobile']; if($user['real_name']!=''){ $item['nickname']=$user['real_name']; }else{ $item['nickname']=$user['mobile']; } - }else{ - $item['nickname']='无'; } - }else{ - $item['nickname']='无'; } $item['image']=$find['image'];//商品图片 $item['system_store']=SystemStore::where('id',$item['store_id'])->value('name')??""; @@ -130,14 +129,15 @@ class StoreOrderCartInfoLists extends BaseAdminDataLists implements ListsSearchI { $data=[ 'store_name' => '商品名称', - 'system_store' => '门店', - 'nickname' => '用户', + 'system_store' => '门店',, 'store_info' => '规格', 'unit_name' => '单位', 'cate_name' => '分类', 'cart_num' => '数量', 'price' => '单价', 'total_price' => '总价', + 'nickname' => '用户', + 'mobile' => '手机', 'create_time' => '时间', ]; return $data; diff --git a/app/admin/lists/store_product/StoreProductLists.php b/app/admin/lists/store_product/StoreProductLists.php index 85b0210f..4be517aa 100644 --- a/app/admin/lists/store_product/StoreProductLists.php +++ b/app/admin/lists/store_product/StoreProductLists.php @@ -32,7 +32,7 @@ class StoreProductLists extends BaseAdminDataLists implements ListsSearchInterfa public function setSearch(): array { return [ - '=' => ['cate_id', 'is_show', 'bar_code'], + '=' => ['cate_id', 'is_show', 'bar_code','product_type'], '<=' => ['stock'], '%like%' => ['store_name'], ]; @@ -73,7 +73,6 @@ class StoreProductLists extends BaseAdminDataLists implements ListsSearchInterfa $item['bar_code_two'] = ''; } $item['bar_code'] = ''; - $item['unit_names'] = '称重商品'; } else { if (strlen($item['bar_code']) < 10) { $item['bar_code_two'] = $item['bar_code']; @@ -82,30 +81,28 @@ class StoreProductLists extends BaseAdminDataLists implements ListsSearchInterfa } $item['bar_code'] = ''; } - $item['unit_names'] = '标准商品'; } - + switch($item['product_type']){ + case 2: + $item['product_type_name'] = '兑换产品'; + break; + case 3: + $item['product_type_name'] = '赠品'; + break; + case 4: + $item['product_type_name'] = '活动产品'; + break; + case 5: + $item['product_type_name'] = '批发产品'; + break; + default: + $item['product_type_name'] = '普通商品'; + } $item['unit_name'] = StoreProductUnit::where('id', $item['unit'])->value('name'); $nums = WarehouseProductStorege::where('product_id', $item['id'])->sum('nums'); $stock = StoreBranchProduct::where('store_id', '<>', '4')->where('product_id', $item['id'])->sum('stock'); $item['stock'] = bcadd($nums, $stock); - $cate_name = ''; - $category_top = StoreCategory::where('id', $item['top_cate_id'])->value('name'); - if ($category_top != '') { - $cate_name = '/' . $category_top; - } - if (!$category_top) { - $category_two = StoreCategory::where('id', $item['two_cate_id'])->value('name'); - if ($category_two != '') { - $cate_name = $cate_name . '/' . $category_two; - } - } - $category_three = StoreCategory::where('id', $item['cate_id'])->value('name'); - if ($category_three) { - $cate_name = $cate_name . '/' . $category_three; - } - $item['cate_name'] = $cate_name; - // $item['cate_name'] = StoreCategory::where('id', $item['cate_id'])->value('name'); + $item['cate_name'] = StoreCategory::where('id', $item['cate_id'])->value('name'); return $item; })?->toArray(); } @@ -158,8 +155,8 @@ class StoreProductLists extends BaseAdminDataLists implements ListsSearchInterfa { $data = [ 'id' => '商品id', - 'unit_names' => '计价方式', 'store_name' => '商品名称', + 'product_type_name' => '商品类型', 'cate_name' => '分类', 'unit_name' => '单位', 'store_info' => '规格', @@ -168,7 +165,6 @@ class StoreProductLists extends BaseAdminDataLists implements ListsSearchInterfa 'cost' => '商户', 'price' => '零售', 'bar_code' => '条码', - 'bar_code_two' => '自编码', ]; return $data; } diff --git a/app/api/logic/order/OrderLogic.php b/app/api/logic/order/OrderLogic.php index fb9ac27a..7688db66 100644 --- a/app/api/logic/order/OrderLogic.php +++ b/app/api/logic/order/OrderLogic.php @@ -92,12 +92,9 @@ class OrderLogic extends BaseLogic $off_activity = Config::where('name', 'off_activity')->value('value'); $field = 'id,store_name,image,unit,price,vip_price,cost,purchase,cate_id,store_info,rose'; foreach ($cart_select as $k => $v) { - if ($source == 2) { - $field = 'product_id,product_id id,store_name,image,unit,price,vip_price,cost,purchase,cate_id,store_info,rose'; - $find = StoreBranchProduct::where(['product_id' => $v['product_id'], 'store_id' => $params['store_id']])->field($field)->find(); - } else { - $find = StoreProduct::where(['id' => $v['product_id']])->field($field)->find(); - } + $source=$v['source']; + $find = StoreProduct::where(['id' => $v['product_id']])->field($field)->find(); + if (!$find) { throw new BusinessException('商品不存在'); }