title = '影评列表'; $f_id = input('f_id'); $this->film = Db::table('film_list')->find($f_id); $this->_query($this->table) ->alias('c') ->field('c.*,m.name as user_name , o.price_total') ->join('store_member m','c.uid = m.id',"LEFT") ->join('ticket_order o','c.order_id = o.id','LEFT') ->where(['c.f_id'=>$f_id]) ->order('id desc') ->page(); } /** * @auth true * @menu true * 数据处理 * @param array $data * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\ModelNotFoundException * @throws \think\exception\DbException */ protected function _index_page_filter(array &$data) { $mids = array_unique(array_column($data, 'uid')); $memberList = Db::name('StoreMember')->whereIn('id', $mids)->select(); foreach ($data as &$vo) { if($vo['images']) $vo['images'] = explode(',',$vo['images']); foreach ($memberList as $member){ if ($member['id'] === $vo['uid']) $vo['member'] = $member; } } } }