getNum($where); if ($num <= 0) { continue; } $data = array(); $data['day'] = $where['start']; $info = Dever::db('user/stat')->find($data); $data['user'] = $num; $order = Dever::config('base')->passport_stat_order; if ($order) { $order = Dever::load($order, $where); $data['order_user'] = $order; } $data['qoq'] = 0; if (!$info) { Dever::db('user/stat')->insert($data); } else { $data['where_id'] = $info['id']; Dever::db('user/stat')->update($data); } } } # 获取环比增长 public function qoq($user, $day) { $where = array('day' => Dever::maketime($day)); $search = Dever::search_button(); if ($search) { $where['config']['group'] = $search[0]; $where['config']['col'] = str_replace('|id', '', $search[1]); } $prev = Dever::db('user/stat')->prev($where); if ($prev) { $qoq = round(($user-$prev['user'])/$prev['user'], 2)*100; } else { $qoq = 0; } return $qoq . '%'; } }