error(); } //拿收藏的ids $where = [ 'worker_id' => $this->auth->id, 'table' => $table, ]; $table_ids = Db::name('worker_collect')->where($where)->group('table_id')->column('table_id'); if(!empty($table_ids)){ $ids_str = implode(',',$table_ids); //字段 $table_field = [ 'jishuguifan' => 'id,name,ismenu', 'news' => 'id,title,image,createtime', 'caozuoguifan' => 'id,title,image,createtime', ]; $list = Db::name($table)->field($table_field[$table]) ->where('id','IN',$table_ids) ->orderRaw('field(id,'.$ids_str.')') ->autopage() ->select(); $list = list_domain_image($list,['image']); }else{ $list = []; } $this->success(1, $list); } //下载功能 public function download_list(){ $list = Db::name('worker_download')->alias('down') ->join('jishuguifan j','down.table_id = j.id','LEFT') ->field('j.id,j.name,j.ismenu,down.updatetime') ->where('down.worker_id',$this->auth->id) ->autopage() ->group('down.table_id') ->select(); $this->success(1,$list); } }