refill_order.model.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. use const mtopcard\PetroChinaCard;
  3. use const mtopcard\PhoneCard;
  4. use const mtopcard\SinopecCard;
  5. defined('InShopNC') or exit('Access Invalid!');
  6. class refill_orderModel extends Model
  7. {
  8. public function getOrderInfo($condition = [], $fields = '*', $master = false)
  9. {
  10. $order_info = $this->table('refill_order')->field($fields)->where($condition)->master($master)->find();
  11. if (empty($order_info)) {
  12. return [];
  13. }
  14. return $order_info;
  15. }
  16. public function add_refill($params)
  17. {
  18. return $this->table('refill_order')->insert($params);
  19. }
  20. public function edit($order_id,$data)
  21. {
  22. return$this->table('refill_order')->where(['order_id' => $order_id])->update($data);
  23. }
  24. public function getMerchantOrderList($condition, $pagesize = '', $field = '*', $order = 'refill_order.order_id desc', $limit = '')
  25. {
  26. $list = $this->table('refill_order,vr_order')->field($field)->where($condition)->join('left')->on('refill_order.order_id=vr_order.order_id')->page($pagesize)->order($order)->limit($limit)->select();
  27. if (empty($list)) return [];
  28. return $list;
  29. }
  30. }