Przeglądaj źródła

增值包组件

gorden 5 miesięcy temu
rodzic
commit
39f34bcdd5

+ 26 - 0
app/admin/controller/content/NewsPageController.php

@@ -0,0 +1,26 @@
+<?php
+
+namespace app\admin\controller\content;
+
+use app\controller\Curd;
+use app\model\Content;
+use app\model\SysCategory;
+use support\Request;
+use support\Response;
+
+class NewsPageController extends Curd{
+    public function __construct()
+    {
+        $this->model = new Content();
+    }
+
+    public function select(Request $request) : Response 
+    {
+        $categoryIds = SysCategory::where('category_super_id',61)->select('category_id')->get()->toArray();
+        $where['join_content_category_id'] = ['in',$categoryIds];
+        [$where, $format, $limit, $field, $order] = $this->selectInput($request);
+        $query = $this->doSelect($where, $field, $order);
+        return $this->doFormat($query, $format, $limit);
+
+    }
+}

+ 4 - 2
app/admin/controller/content/SpecialController.php

@@ -7,6 +7,7 @@ use app\model\Content;
 use support\exception\BusinessException;
 use support\Request;
 use support\Response;
+use Tinywan\Jwt\JwtToken;
 
 class SpecialController extends Curd
 {
@@ -84,12 +85,13 @@ class SpecialController extends Curd
     protected function insertInput(Request $request): array
     {
         $data = $this->inputFilter($request->post());
-        $data['content_config_json'] = [];
         if (!empty($request->post('cover'))) {
-            $configJson = !empty($model->content_config_json) ? json_decode($model->content_config_json, true) : [];
             $configJson['cover'] = str_replace(getenv("STORAGE_DOMAIN"), '', $request->post('cover'));
             $data['content_config_json'] = json_encode($configJson);
         }
+        $data['content_updatetimes'] = time();
+        $data['creator_user_id'] = JwtToken::getCurrentId();
+        dump($data);
 
         return $data;
     }

+ 3 - 3
app/admin/controller/finance/GoodsSalesController.php

@@ -11,9 +11,9 @@ class GoodsSalesController{
     {
         $rows = OrderSheet::leftJoin('goods','goods.goods_id','=','order_sheet.join_sheet_goods_id')
             ->leftJoin('goods_sku','goods_sku.join_sku_goods_id','=','order_sheet.join_sheet_goods_id')
-            ->selectRaw('SUM(app_order_sheet.order_sheet_num) as num,SUM(app_order_sheet_pay) as amount,CONCAT(app_goods.goods_id,"-",app_goods_sku.goods_sku_id) as goods_flag')
-            ->orderBy('order_sheet_addtimes','DESC')
-            ->groupBy('goods_flag')
+            ->selectRaw('app_goods.goods_id,SUM(app_order_sheet.order_sheet_num) as num,SUM(app_order_sheet.order_sheet_pay) as amount,app_goods.goods_id,app_goods_sku.goods_sku_id')
+            ->groupBy(['goods.goods_id','goods_sku.goods_sku_id'])
+            ->orderBy('num','DESC')
             ->get();
 
         dump($rows);

+ 1 - 0
app/admin/service/goods/GoodsService.php

@@ -83,6 +83,7 @@ class GoodsService
             }
 
             $categoryIds = SysCategory::where('category_super_path', 'like', '%' . $item['category_super_path'])->pluck('category_id');
+            dump($categoryIds);
             $categoryIds = $categoryIds ? $categoryIds->toArray() : [];
             $categorySuperIds = array_merge($categorySuperIds, $categoryIds);
         }