colly_wyx
2017-08-10 f7a98b088d5f7246cf12ee072169057a8e762664
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
    /**
     * 数据控制器
     */
    class DataController extends System_Controller_Web{
        
        /**
         * 数据汇总
         * @return [type] [description]
         */
        public function DailyAction(){
            $daily_service = new Service_Daily();
            $day = $this->get('day', date('Y-m-d'));
            $dailyLog_service = new Service_DailyLog();
            if(strtotime($day) <= strtotime(date('Y-m-d', time()))){
                if(!$dailyLog_service->isSummary($day)){
                    if($daily_service->summary($day)){
                        echo "汇总成功";
                    }
                    else{
                        echo "汇总失败";
                    }
                }
                else{
                    echo '当天已经汇总过了';
                }
            }
            else{
                echo $day.'无法进行汇总';
            }
            die();
        }
 
    }