model = new \addons\qingdong\model\Record(); } /** * 查看 */ public function index() { //设置过滤方法 if ($this->request->isAjax()) { $params = $this->request->get(); list($where, $sort, $order, $offset, $limit) = $this->buildparams(); $wheres = []; $wheres['relation_id'] = $params['ids']; $list = $this->model->with(['file','staff'])->where($where)->where($wheres) ->order($sort, $order)->paginate($limit); $data = $list->items(); //// foreach($data as &$v){ //// $contract_remark=''; //// $contract_other = $v['contract_other']; //// $otherdata = json_decode($contract_other['otherdata'],true); //// if(is_array($otherdata)){ //// if(isset($otherdata['other_upnhey'])){ //// $contract_remark = $otherdata['other_upnhey']; //// } //// if(isset($otherdata['other_zdywys'])){ //// $contract_remark = $otherdata['other_zdywys']; //// } //// } //// $v['contract_remark'] = $contract_remark; ////// outFileLog($contract_remark,'cus_contract','$v'); // } $result = array("total" => $list->total(), "rows" => $list->items()); return json($result); } return $this->view->fetch(); } }