refill_exception.model.php 976 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. defined('InShopNC') or exit('Access Invalid!');
  3. class refill_exceptionModel extends Model
  4. {
  5. public function __construct()
  6. {
  7. parent::__construct('refill_exception');
  8. }
  9. public function getExceptionList($condition, $pagesize = '',$total = 0, $field = '*', $order = 'add_time desc', $limit = '', $master = false)
  10. {
  11. $list = $this->field($field)->where($condition)->page($pagesize,$total)->order($order)->limit($limit)->master($master)->select();
  12. if (empty($list)) return [];
  13. return $list;
  14. }
  15. public function setHandled($exc_id, $update)
  16. {
  17. $update['except_state'] = 1;
  18. return $this->where(['except_id' => $exc_id])->update($update);
  19. }
  20. public function add_except($datas)
  21. {
  22. return $this->insert($datas);
  23. }
  24. public function exist_order($order_sn)
  25. {
  26. $item = $this->field('*')->where(['order_sn' => $order_sn])->find();
  27. return !empty($item);
  28. }
  29. }