field("value")->where(['key'=>"cp_company_api"])->find(); $data = json_decode(curl_post($url['value'],$request),true); // dump($request);die(); if($_REQUEST['export']) { $list_data = $data['data']; foreach ($list_data as $key => $value) { $list_data[$key]['agreement_time'] = json_decode($list_data[$key]['agreement_time'],true); $list_data[$key]['balance_time'] = json_decode($list_data[$key]['balance_time'],true); $list_data[$key]['agreement_time']['start_time'] = date("Y-m-d H:i:s",$list_data[$key]['agreement_time']['start_time']); ($list_data[$key]['agreement_time']['end_time']!=1)?($list_data[$key]['agreement_time']['end_time'] = date("Y-m-d H:i:s",$list_data[$key]['agreement_time']['end_time'])):($list_data[$key]['agreement_time']['end_time'] = ""); $list_data[$key]['balance_time']['start_time'] = date("Y-m-d H:i:s",$list_data[$key]['balance_time']['start_time']); ($list_data[$key]['balance_time']['end_time']!=1)?($list_data[$key]['balance_time']['end_time'] = date("Y-m-d H:i:s",$list_data[$key]['balance_time']['end_time'])):($list_data[$key]['balance_time']['end_time'] = ""); } $this->assign("listdata",$list_data); $this->display("export");die(); } else { $page = set_pagination($data['count'], $row); if ($page) { $this->assign('_page', $page); } $this->assign("listdata",$data['data']); $this->display(); } } public function detail() { $_REQUEST['id']?($request['id'] = $_REQUEST['id']):''; $data = json_decode(curl_post("http://10.0.1.161:8095/index.php?g=Api&m=CpJuheCompany&a=detail",$request),true); $this->assign("data",$data); $this->display(); } }