refill_stats.model.php 812 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. defined('InShopNC') or exit('Access Invalid!');
  3. class refill_statsModel extends Model
  4. {
  5. public function __construct()
  6. {
  7. parent::__construct('refill_stats');
  8. }
  9. public function latest_record_time()
  10. {
  11. return $this->field('*')->where(['stat_id' => ['gt', 0], 'type' => 'system'])->order('stat_id desc')->limit(0)->find();
  12. }
  13. public function getStatsInfo($condition = [], $fields = '*', $master = false, $lock = false)
  14. {
  15. $stats_info = $this->field($fields)->where($condition)->order('')->master($master)->lock($lock)->find();
  16. if (empty($stats_info)) {
  17. return [];
  18. }
  19. return $stats_info;
  20. }
  21. public function edit($stat_id,$data)
  22. {
  23. return $this->where(['stat_id' => $stat_id])->update($data);
  24. }
  25. }