getDisplayColumn('Operation_Search'); $OperationTableColumns = column::getInstance()->tableColumns('Operation_Search',$column); $data['OperationTableColumns'] = $OperationTableColumns; common::echo_json_encode(200,$data); exit(); } /* * operation_search search */ if ($operate == "search") { $this->_operation_search(); } } /* * operation_search search */ private function _operation_search() { $cp = common::check_input($_POST ['cp']); //current_page $ps = common::check_input($_POST ['ps']); //ps if (empty($ps)) $ps = 10; $sqlWhere = ' where 1=1'; $user_name = common::check_input($_POST ['user_name']); $user_type = common::check_input($_POST ['user_type']); $page = common::check_input($_POST ['page']); $operation = common::check_input($_POST ['operation']); if (!empty($user_name)){ $sqlWhere .= " and user_name ilike '%" . $user_name . "%'"; } if (!empty($user_type)){ $sqlWhere .= " and lower(user_type) = '".strtolower($user_type)."'"; } if (!empty($page)){ $sqlWhere .= " and lower(page) = '".strtolower($page)."'"; } if (!empty($operation)){ $sqlWhere .= " and lower(operation) = '".strtolower($operation)."'"; } if (isset($_POST['operation_date_start']) && !empty($_POST['operation_date_start'])) $sqlWhere .= " and operation_time >= '" . common::usDate2sqlDate($_POST['operation_date_start']) . " 00:00:00'"; if (isset($_POST['operation_date_end']) && !empty($_POST['operation_date_end'])) $sqlWhere .= " and operation_time <= '" . common::usDate2sqlDate($_POST['operation_date_end']) . " 23:59:59'"; $rc = $_POST ['rc']; if ($rc == - 1) { $sql = "SELECT count(1) from public.customer_service_operation_log" . $sqlWhere; $rc = common::excuteOneSql($sql); } $tp = ceil($rc / $ps); $order_by = " id"; if ($rc > 0) { $sql = "SELECT * from public.customer_service_operation_log " . $sqlWhere . " order by $order_by limit " . $ps . " offset " . ($cp - 1) * $ps; $rs = common::excuteListSql($sql); //处理operation_detail 可以放在保存的时候做(待定) foreach($rs as $key => $val){ $json = $val['operation_detail']; if(!empty($json)){ $_text = ''; $data = json_decode($json,true); foreach ($data as $jk => $jv) { $_text .= $jk.":".$jv."; "; } $rs[$key]["operation_detail"] = $_text; } } $arrTmp = array('searchData' => $rs, 'rc' => $rc, 'ps' => $ps, 'cp' => $cp, 'tp' => $tp); } else { $arrTmp = array('searchData' => array()); } common::echo_json_encode(200,$arrTmp); exit(); } } ?>