|
- <?php
- require_once 'dictionary.php';
- header("Access-Control-Allow-Origin:*");
-
- $post = $_POST;
- $keywords = $post['keywords'];
- if(!empty($keywords)){
- $str = " and b.CHAN_NAME like '%$keywords%'";
- }else{
- $str = "";
- }
-
- $currpage = $_POST['cur'];
- $pagesize = $_POST['pagesize'];
- $num = ($currpage-1)*$pagesize;
-
- $sql = "select a.ID,a.APPLY_TIME,a.APPLY_MONEY,a.BANK_NAME,a.APPLY_MONEY,a.BANK_ACCOUNT,a.STUTA,b.CUST_ID,b.CHAN_QUALITY,b.CHAN_TYPE,b.CHAN_NAME from base_apply as a,base_customer as b where a.CUST_ID = b.CUST_id".$str." limit ".$num.",".$pagesize;
-
- $result = $pdo ->query($sql);
-
- if($result){
- $list=$result->fetchAll(PDO::FETCH_ASSOC);
- $code = 0;
- $info = 'success';
- $massge = '成功';
- foreach($list as $k => $v){
- foreach($v as $kk => $vv){
- if(array_key_exists($kk,$coutomer)){
- $list[$k][$kk] = $coutomer[$kk][$vv];
- }
- }
- if($v['STUTA'] == 1){
- $list[$k]['STUTAS'] = "未处理";
- }
- else{
- $list[$k]['STUTAS'] = "已处理";
- }
- }
- $sql = "select count(*) as totalNum from base_apply as a,base_customer as b where a.CUST_ID = b.CUST_id".$str;
- $result=$pdo->query($sql);
- $totalNum = $result->fetchAll(PDO::FETCH_ASSOC);
- $totalNum = $totalNum[0]['totalNum'];
- }else{
- $code = -1;
- $info = 'fail';
- $massge = '失败';
- $totalNum = 0;
- $list = '';
- }
-
- $json['code'] = $code;
- $json['info'] = $info;
- $json['massge'] = $massge;
- $json['totalNum'] = $totalNum;
- $json['list'] = $list;
- //print_r($json);
- echo json_encode($json);
- ?>
|