Browse Source

首页专题

gorden 4 months ago
parent
commit
41d3a99e0b

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

@@ -1,26 +0,0 @@
-<?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 - 6
app/admin/controller/content/SpecialController.php

@@ -28,11 +28,7 @@ class SpecialController extends Curd
 
     protected function doSelect(array $where, string $field = null, string $order = 'desc')
     {
-        $model = $this->model->with([
-            'category' => function ($query) {
-                $query->select('category_id', 'category_name');
-            }
-        ]);
+        $model = $this->model;
         foreach ($where as $column => $value) {
             if (is_array($value)) {
                 if ($value[0] === 'like' || $value[0] === 'not like') {
@@ -101,6 +97,8 @@ class SpecialController extends Curd
         $primary_key = $this->model->getKeyName();
         $id = $request->post($primary_key);
         $data = $this->inputFilter($request->post());
+        $data['content_updatetimes'] = time();
+
         $model = $this->model->find($id);
 
         if (!$model) {
@@ -110,7 +108,7 @@ class SpecialController extends Curd
         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'));
-            $model->content_config_json = json_encode($configJson);
+            $data['content_config_json'] = json_encode($configJson);
         }
 
         unset($data[$primary_key]);

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

@@ -83,7 +83,6 @@ 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);
         }