Gao преди 2 години
родител
ревизия
cfcc0b2b0f
променени са 1 файла, в които са добавени 10 реда и са изтрити 2 реда
  1. 10 2
      application/api/controller/Programme.php

+ 10 - 2
application/api/controller/Programme.php

@@ -126,15 +126,23 @@ class Programme extends Api
      *ApiReturnParams (name=id,description=方案id)
      * ApiReturnParams (name=name,description=方案名称)
      * ApiReturnParams (name=createtime,description=创建时间)
+     * ApiReturnParams (name=sku_id,description=规格低)
+     * ApiReturnParams (name=sku,description=规格名称)
+     * ApiReturnParams (name=num,description=数量)
      */
     public function lists(){
         $user=$this->auth->getUser();
         $lists=$user->programmes()
             ->order('id','desc')
             ->paginate(input('limit',15));
+        $data = $lists->toArray();
+        $list = $data['data'];
+        foreach ($list as  &$v){
+            $v['goods'] = Db('ProgrammeGoods')->field('sku_id,sku,num')->where('programme_id',$v['id'])->select();
+        }
+        $data['data'] = $list;
 
-
-        $this->success('',$lists);
+        $this->success('',$data);
     }
     /**
      * 查看方案