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.
 
 
 
 
 
 

89 lines
1.6 KiB

<?php
error_reporting(0);
include 'DB.php';
try {
$code=$_REQUEST['a'];
if($code=="jz"){
$area="018"; //荆州
}elseif ($code=="qz"){
$area="016"; //泉州
}elseif ($code=="sh"){
$area="007"; //上海
}
elseif ($code=="cz"){
$area="006"; //长治
}elseif ($code=="zb"){
$area="008"; //淄博
}
elseif ($code=="nj"){
$area="002"; //南京
}
elseif ($code=="jy"){
$area="001A"; //江阴
}
elseif ($code=="xs"){
$area="020"; //响水
}
elseif ($code=="yt"){
$area="005"; //烟台
}
elseif ($code=="ha"){
$area="016"; //惠安
}
elseif ($code=="qzxmj"){
$area="016"; //泉州新门街
}
elseif ($code=="jj"){
$area="016"; //晋江
}
elseif ($code=="xm"){
$area="016"; //厦门门店
}elseif ($code=="lz"){
$area="008"; //临淄
} else{
$area="018";
}
$conn=new DB();
if($conn){
$sql="select phbmobie,phbcardno,sum(phbamount) as sumamount ,phbcreatetime from phb where phbarea='$area' and phbid not in (select t.phbid from (select phbid,phbmobie,phbcardno,sum(phbamount) as sumamount ,phbcreatetime from phb group by phbcardno order by sum(phbamount) desc limit 0,9) as t ) group by phbcardno order by sum(phbamount) desc limit 0,2";
$result=$conn->getRowsArray($sql);
for ($x=0; $x<sizeof($result);$x++) {
$status[$x]['phbmobie']=substr_replace($result[$x]['phbmobie'], '****', 3, 4);
$status[$x]['phbcardno']=$result[$x]['phbcardno'];
$status[$x]['sumamount']=$result[$x]['sumamount'];
$status[$x]['phbcreatetime']=$result[$x]['phbcreatetime'];
$status[$x]['x']= $x+1;
}
//$phbmobile=substr_replace($tel, '****', 3, 4);
echo json_encode($status);
}
}catch (Exception $e) {
die($e->getMessage());
}
?>