['except' => ['Case','Store'] ] ]; protected function getData($cid){ $where = ['category_id'=>$cid]; $list = Db::table('fa_article')->field('id') // ->withAttr('enroll', // function($value, $data){ // return Db::table(self::ARTICLE_PUBLIC_BENEFIT)->field('promoter,enrolled_num')->where('article_id', $data['id'])->find(); // } // ) ->where($where) ->page(1) ->limit(10) ->order('id desc') ->select(); return $list; } public function Case(){ $data = $this->getData(499); $this->apiSuccess('ok', ['list' => $data]); } public function Store(){ $data = $this->getData(501); $this->apiSuccess('ok', ['list' => $data]); } }