|
@@ -409,6 +409,26 @@ class TestMemberCard extends TestCase
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ $str = $this->format($result);
|
|
|
+ file_put_contents(BASE_DATA_PATH .'/cards/useramounts.txt',$str);
|
|
|
+ }
|
|
|
+
|
|
|
+ private function format($data){
|
|
|
+ $typeArr = ['中石油','中石化','中国联通','中国电信','中国移动'];
|
|
|
+ $str = '';
|
|
|
+ foreach ($data as $key => $val){
|
|
|
+ $str .= "用户ID : {$key},充值统计:";
|
|
|
+ foreach ($val as $k => $v){
|
|
|
+ if($v == 0){
|
|
|
+ continue;
|
|
|
+ }else{
|
|
|
+ $str .= "{$typeArr[$k-1]} : {$v}元,";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $str = rtrim($str , ',');
|
|
|
+ $str .= "\r\n";
|
|
|
+ }
|
|
|
+ return $str;
|
|
|
}
|
|
|
|
|
|
private function carrier_type($phone)
|