|
@@ -408,4 +408,32 @@ class commandControl extends BaseCronControl
|
|
|
$sort_num++;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ public function update_pvOp()
|
|
|
+ {
|
|
|
+ $from = 1496592000;
|
|
|
+ $now = strtotime(date('Y-m-d',time()));
|
|
|
+ while ($from <= $now)
|
|
|
+ {
|
|
|
+ $this->update_daily_pv($from);
|
|
|
+ $from += 86400;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private function update_daily_pv($timestep){
|
|
|
+ $mod_stat = Model('stat_daily');
|
|
|
+ $info = $mod_stat->table('stat_daily')->field('call_record')->where(['date_id' => $timestep])->find();
|
|
|
+ if(empty($info) || empty($info['call_record'])){
|
|
|
+ return false;
|
|
|
+ } else {
|
|
|
+ $call_record = json_decode($info['call_record'],true);
|
|
|
+ $sum = intval($call_record['ios_count']) + intval($call_record['android_count']) + intval($call_record['android_count']);
|
|
|
+ if($sum > 0) {
|
|
|
+ $mod_stat->table('stat_daily')->where(["date_id" => $timestep])->update(["pv" => $sum]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|