|
@@ -28,6 +28,7 @@ class Manage
|
|
|
$data['start'] = date('Y-m-d',$start);
|
|
|
$data['day'] = $this->content_api($where,1);
|
|
|
$data['money'] = $this->c_api($where);
|
|
|
+ $data['week'] = $this->zhou_api($start);
|
|
|
$data['all'] = $this->content_api($w,2);
|
|
|
$data['all_money'] = $this->c_api($w);
|
|
|
$data['time'] = $this->day_time_api($w);
|
|
@@ -36,7 +37,7 @@ class Manage
|
|
|
$data['qu_money'] = Dever::json_encode($data['money_time']);
|
|
|
$data['xzhou'] = $this->button_day_api($w,1);
|
|
|
$data['zhou'] = Dever::json_encode($data['xzhou']);
|
|
|
- $data['week'] = $this->zhou_api($start);
|
|
|
+
|
|
|
return Dever::render('census', $data);
|
|
|
}
|
|
|
|
|
@@ -155,6 +156,14 @@ class Manage
|
|
|
}
|
|
|
|
|
|
public function day_time_api($w){
|
|
|
+ $time = date('m',time()) - date('m',$w['fstart']);
|
|
|
+ $start = date('Y-m-01',$w['fstart']);
|
|
|
+ if($time<=0){
|
|
|
+ $w['fend'] = time();
|
|
|
+ }elseif($time>0){
|
|
|
+ $w['fend'] = strtotime(date('Y-m-d 23:59:59',
|
|
|
+ strtotime($start."+1 month - 1 day")));
|
|
|
+ }
|
|
|
$days = ($w['fend']-$w['fstart'])/86400+1;
|
|
|
|
|
|
$day = array();
|
|
@@ -172,6 +181,7 @@ class Manage
|
|
|
$where['status'] = 4;
|
|
|
$res['num'][] = Dever::db('agent/order')->getNum($where);
|
|
|
}
|
|
|
+
|
|
|
$data = array();
|
|
|
$data['name'] = '数量';
|
|
|
$data['type'] = 'line';
|
|
@@ -181,6 +191,14 @@ class Manage
|
|
|
}
|
|
|
|
|
|
public function money_time_api($w){
|
|
|
+ $time = date('m',time()) - date('m',$w['fstart']);
|
|
|
+ $start = date('Y-m-01',$w['fstart']);
|
|
|
+ if($time<=0){
|
|
|
+ $w['fend'] = time();
|
|
|
+ }elseif($time>0){
|
|
|
+ $w['fend'] = strtotime(date('Y-m-d 23:59:59',
|
|
|
+ strtotime($start."+1 month - 1 day")));
|
|
|
+ }
|
|
|
$days = ($w['fend']-$w['fstart'])/86400+1;
|
|
|
|
|
|
$day = array();
|
|
@@ -210,6 +228,14 @@ class Manage
|
|
|
}
|
|
|
|
|
|
public function button_day_api($w,$type){
|
|
|
+ $time = date('m',time()) - date('m',$w['fstart']);
|
|
|
+ $start = date('Y-m-01',$w['fstart']);
|
|
|
+ if($time<=0){
|
|
|
+ $w['fend'] = time();
|
|
|
+ }elseif($time>0){
|
|
|
+ $w['fend'] = strtotime(date('Y-m-d 23:59:59',
|
|
|
+ strtotime($start."+1 month - 1 day")));
|
|
|
+ }
|
|
|
$days = ($w['fend']-$w['fstart'])/86400+1;
|
|
|
if($type ==1){
|
|
|
$daysd = $days-1;
|