model = new \addons\qingdong\model\Contract; } /** * 查看 */ public function index() { //设置过滤方法 if ($this->request->isAjax()) { $params = $this->request->get(); list($where, $sort, $order, $offset, $limit) = $this->buildparams(); $wheres = []; $wheres['customer_id'] = $params['ids']; $list = $this->model->where($where)->where($wheres) ->with([ 'customer', 'orderStaff', 'contacts', 'contractOther' ])->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_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(); } }