wupengfei 2 年之前
父节点
当前提交
b2bfccf04d
共有 2 个文件被更改,包括 37 次插入2 次删除
  1. 2 2
      .idea/workspace.xml
  2. 35 0
      application/api/controller/Mall.php

+ 2 - 2
.idea/workspace.xml

@@ -3,7 +3,7 @@
   <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$/config/apidoc.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/apidoc.php" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/application/api/controller/Mall.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/api/controller/Mall.php" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -221,7 +221,7 @@
       <workItem from="1665189429149" duration="5358000" />
       <workItem from="1665206979508" duration="7749000" />
       <workItem from="1665276346161" duration="19728000" />
-      <workItem from="1665362529961" duration="13048000" />
+      <workItem from="1665362529961" duration="16507000" />
     </task>
     <servers />
   </component>

+ 35 - 0
application/api/controller/Mall.php

@@ -194,5 +194,40 @@ class Mall extends Base
         $coll_status ?  $this->success('收藏成功',['status'=>1]) :    $this->success('取消收藏成功',['status'=>0]);
     }
 
+    /**
+     * @title 商品浏览列表
+     * @desc  商品浏览列表
+     * @author  qc
+     * @url /api/Mall/getGoodsList
+     * @method GET
+     * @header name:Authorization require:1 desc:Token
+     * @param  name:page type:int default:1 desc:页数
+     * @param  name:page_num type:int default:20 desc:每页数
+     * @param  name:name type:string require:0  default:-- desc:商品名称
+     * @return name:name type:string default:-- desc:商品名称
+     * @return name:cover type:string default:-- desc:商品封面图
+     * @return name:desc type:string default:-- desc:商品简述(副标题)
+     * @return name:low_price type:float default:-- desc:最低售价
+     */
+    public function getGoodsHistory()
+    {
+        $sel_where  = [];
+        $sel_where[]  = ['t.user_id','=',$this->user_id];
+        $sel_where[]  = ['t.type','=',6];
+        $title = input('get.name');
+        if($title)  $sel_where[]  = ['i.name','like','%'.$title.'%'];
+        $list = UserTrack::where($sel_where)
+            ->alias('t')
+            ->field('t.id,t.update_int,t.first_id goods_id,i.name,i.cover,i.low_price')
+            ->leftJoin('StoreGoods i','t.second_id = i.id')
+            ->order('update_int desc')
+            ->limit($this->off_set,$this->page_num)
+            ->select()->toArray();
+        foreach ($list as &$v) {
+            $v['time'] = date("Y-m-d H:i:s",$v['update_int']);
+        }
+        $this->success('ok',['list'=>$list]);
+    }
+
 
 }