123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- <?php
- /**
- * Created by PhpStorm.
- * User: xiaofeng
- * Date: 2018/4/19
- * Time: 下午2:52
- */
- namespace frontend\controllers;
- use frontend\base\CommonController;
- use common\models\Enroll;
- use backend\server\Houses;
- use backend\base\Help;
- use Yii;
- class StatsController extends CommonController
- {
- public $enableCsrfValidation = false;
- //格式 action 必须的 首字符大写,其余的都是小写。
- public function actionIndex(){
- if(!empty($_GET['value'])){
- switch ($_GET['value']) {
- case 'tCall':
- $t1 = json_decode(file_get_contents('http://pfg.office.kaipie.com/public/webclient.ashx?bm=3&t=count'),true);
- $t2 = json_decode(file_get_contents('http://pfg.office.kaipie.com/public/webclient.ashx?bm=4&t=count'),true);
- $t3 = json_decode(file_get_contents('http://pfg.office.kaipie.com/public/webclient.ashx?bm=5&t=count'),true);
- $merge = array($t1[0],$t2[0],$t3[0]);
- $num = 0;
- foreach($merge as $val){
- $num += $val['value'];
- }
- $result[]['value'] = $num;
- break;
- // 总来电(岛内)
- case 'CallCount':
- $pf = json_decode(file_get_contents('http://pfg.office.kaipie.com/public/webclient.ashx?bm=1&t=count'),true);
- $yf = json_decode(file_get_contents('http://pfg.office.kaipie.com/public/webclient.ashx?bm=2&t=count'),true);
- $t1 = json_decode(file_get_contents('http://pfg.office.kaipie.com/public/webclient.ashx?bm=3&t=count'),true);
- $t2 = json_decode(file_get_contents('http://pfg.office.kaipie.com/public/webclient.ashx?bm=4&t=count'),true);
- $t3 = json_decode(file_get_contents('http://pfg.office.kaipie.com/public/webclient.ashx?bm=5&t=count'),true);
-
- $merge = array($pf[0],$yf[0],$t1[0],$t2[0],$t3[0]);
- $num = 0;
- foreach($merge as $val){
- $num += $val['value'];
- }
- $result[]['value'] = $num;
- break;
- //品房网报名
- case 'bmcount':
- $time = date("Y-m-d",time());
- $Enroll = new Enroll();
- $Enrollcount = $Enroll->getList(['start_time'=>$time,'end_time'=>$time]);
- foreach($Enrollcount as &$val){
- $unique[$val['mobile']] = $val;
- }
- $result[]['value'] = count($unique);
- break;
- }
- echo json_encode($result);
- }
-
- }
- }
|