12345678910111213141516171819202122232425262728293031 |
- <?php
- defined('InShopNC') or exit('Access Invalid!');
- class refill_statsModel extends Model
- {
- public function __construct()
- {
- parent::__construct('refill_stats');
- }
- public function latest_record_time()
- {
- return $this->field('*')->where(['stat_id' => ['gt', 0], 'type' => 'system'])->order('stat_id desc')->limit(0)->find();
- }
- public function getStatsInfo($condition = [], $fields = '*', $master = false, $lock = false)
- {
- $stats_info = $this->field($fields)->where($condition)->order('')->master($master)->lock($lock)->find();
- if (empty($stats_info)) {
- return [];
- }
- return $stats_info;
- }
- public function edit($stat_id,$data)
- {
- return $this->where(['stat_id' => $stat_id])->update($data);
- }
- }
|