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) { if ($list_data[$key]['bank_card']){ $list_data[$key]['bank_card'] = ' '.$list_data[$key]['bank_card']; } if ($list_data[$key]['alipay_user']) { $list_data[$key]['alipay_user'] = ' '.$list_data[$key]['alipay_user']; } $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",$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",$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",$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",$list_data[$key]['balance_time']['end_time'])):($list_data[$key]['balance_time']['end_time'] = ""); if ($list_data[$key]['agreement_time']['start_time']) { $list_data[$key]['agreement_time']['start_time'] = date("Y-m-d", $list_data[$key]['agreement_time']['start_time']); } else { $list_data[$key]['agreement_time']['start_time'] = "未设置"; } if($list_data[$key]['agreement_time']['end_time']) { ($list_data[$key]['agreement_time']['end_time'] != 1) ? ($list_data[$key]['agreement_time']['end_time'] = date("Y-m-d", $list_data[$key]['agreement_time']['end_time'])) : ($list_data[$key]['agreement_time']['end_time'] = ""); } else { $list_data[$key]['agreement_time']['end_time'] = "未设置"; } if ($list_data[$key]['balance_time']['start_time']) { $list_data[$key]['balance_time']['start_time'] = date("Y-m-d", $list_data[$key]['balance_time']['start_time']); } else { $list_data[$key]['balance_time']['start_time'] = "未设置"; } if($list_data[$key]['balance_time']['end_time']) { ($list_data[$key]['balance_time']['end_time'] != 1) ? ($list_data[$key]['balance_time']['end_time'] = date("Y-m-d", $list_data[$key]['balance_time']['end_time'])) : ($list_data[$key]['balance_time']['end_time'] = ""); } else { $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']):''; $url = M("kv")->field("value")->where(['key'=>"cp_company_detail_api"])->find(); $data = json_decode(curl_post($url['value'],$request),true); $this->assign("data",$data); $this->display(); } }