chuweiqiang 11 months ago
parent
commit
66314d5dbc
2 changed files with 3 additions and 19 deletions
  1. 2 5
      .idea/workspace.xml
  2. 1 14
      application/api/controller/Article.php

+ 2 - 5
.idea/workspace.xml

@@ -1,10 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project version="4">
   <component name="ChangeListManager">
-    <list default="true" id="1a36929e-c054-4875-a943-593a74e55fa4" name="Default Changelist" comment="">
-      <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/application/api/controller/Article.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/api/controller/Article.php" afterDir="false" />
-    </list>
+    <list default="true" id="1a36929e-c054-4875-a943-593a74e55fa4" name="Default Changelist" comment="" />
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
     <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
@@ -596,7 +593,7 @@
       <workItem from="1713916802858" duration="19129000" />
       <workItem from="1714004926744" duration="26309000" />
       <workItem from="1714091498498" duration="11116000" />
-      <workItem from="1714109915098" duration="6380000" />
+      <workItem from="1714109915098" duration="6447000" />
     </task>
     <servers />
   </component>

+ 1 - 14
application/api/controller/Article.php

@@ -386,20 +386,7 @@ class Article extends Base
         $sel_where[]  = ['id','=',input('get.id')];
         $sort_type = input('get.sort_type',1);
         $is_release = UserLearn::checkRelease($this->user_id,3,input('get.id'));
-        $detail = ArticleIntro::where($sel_where)->with(['itemList3'=>function($query)use($sort_type,$is_release){
-            switch ($sort_type) {
-                case 1:
-                    $order =  ['sort'=>'desc','id'=>'asc'];
-                    break;
-                case 2:
-                    $order =  ['id'=>'asc','sort'=>'desc'];
-                    break;
-                case 3:
-                    $order =  ['id'=>'desc','sort'=>'desc'];
-                    break;
-            }
-            return  $is_release ? $query->field('id,article_id,create_at,is_vip,read_num,title,sort,user_id,status,release_time')->force('item')->order($order) : $query->field('id,article_id,create_at,is_vip,read_num,title,sort,user_id,status,release_time')->force('item')->where('status',1)->order($order);
-        }])->find()->toArray();
+        $detail = ArticleIntro::where($sel_where)->find()->toArray();
         $detail['item_list'] = $detail['item_list3'];
         unset($detail['item_list3']);
         $detail['is_release'] = $is_release;