You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

58 lines
1.8 KiB

  1. <?php
  2. require_once 'dictionary.php';
  3. header("Access-Control-Allow-Origin:*");
  4. $post = $_POST;
  5. $keywords = $post['keywords'];
  6. if(!empty($keywords)){
  7. $str = " and b.CHAN_NAME like '%$keywords%'";
  8. }else{
  9. $str = "";
  10. }
  11. $currpage = $_POST['cur'];
  12. $pagesize = $_POST['pagesize'];
  13. $num = ($currpage-1)*$pagesize;
  14. $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;
  15. $result = $pdo ->query($sql);
  16. if($result){
  17. $list=$result->fetchAll(PDO::FETCH_ASSOC);
  18. $code = 0;
  19. $info = 'success';
  20. $massge = '成功';
  21. foreach($list as $k => $v){
  22. foreach($v as $kk => $vv){
  23. if(array_key_exists($kk,$coutomer)){
  24. $list[$k][$kk] = $coutomer[$kk][$vv];
  25. }
  26. }
  27. if($v['STUTA'] == 1){
  28. $list[$k]['STUTAS'] = "未处理";
  29. }
  30. else{
  31. $list[$k]['STUTAS'] = "已处理";
  32. }
  33. }
  34. $sql = "select count(*) as totalNum from base_apply as a,base_customer as b where a.CUST_ID = b.CUST_id".$str;
  35. $result=$pdo->query($sql);
  36. $totalNum = $result->fetchAll(PDO::FETCH_ASSOC);
  37. $totalNum = $totalNum[0]['totalNum'];
  38. }else{
  39. $code = -1;
  40. $info = 'fail';
  41. $massge = '失败';
  42. $totalNum = 0;
  43. $list = '';
  44. }
  45. $json['code'] = $code;
  46. $json['info'] = $info;
  47. $json['massge'] = $massge;
  48. $json['totalNum'] = $totalNum;
  49. $json['list'] = $list;
  50. //print_r($json);
  51. echo json_encode($json);
  52. ?>