refill_exception.model.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. defined('InShopNC') or exit('Access Invalid!');
  3. class refill_exception_type
  4. {
  5. const EUnKnown = 0; //不确定的
  6. const EOfficialSN = 1; //错误的流水号,过短,过长,以及风险流水号
  7. const ERefundOrder = 2; //检测出来的,统付返销
  8. const EqualOfficialSN = 3; // 相同流水号
  9. }
  10. class refill_exceptionModel extends Model
  11. {
  12. public function __construct()
  13. {
  14. parent::__construct('refill_exception');
  15. }
  16. public function getExceptionList($condition, $pagesize = '',$total = 0, $field = '*', $order = 'add_time desc', $limit = '', $master = false)
  17. {
  18. $list = $this->table('refill_exception,refill_order')
  19. ->field($field)->where($condition)
  20. ->join('inner')->on('refill_exception.order_id=refill_order.order_id')
  21. ->page($pagesize,$total)->order($order)->limit($limit)->master($master)->select();
  22. if (empty($list)) return [];
  23. return $list;
  24. }
  25. public function setHandled($exc_id, $update)
  26. {
  27. $update['except_state'] = 1;
  28. return $this->where(['except_id' => $exc_id])->update($update);
  29. }
  30. public function add_except($datas)
  31. {
  32. return $this->insert($datas);
  33. }
  34. public function exist_order($order_sn)
  35. {
  36. $item = $this->field('*')->where(['order_sn' => $order_sn])->find();
  37. return !empty($item);
  38. }
  39. }