live_order.model.php 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <?php
  2. /**
  3. * 线下抢购订单管理
  4. *
  5. *
  6. *by abc.com 多用户商城 运营版
  7. */
  8. defined('InShopNC') or exit('Access Invalid!');
  9. class live_orderModel extends Model {
  10. public function __construct(){
  11. parent::__construct('live_order');
  12. }
  13. /**
  14. * 线下抢购订单
  15. * @param array $condition
  16. * @param string $field
  17. * @return array
  18. */
  19. public function live_orderInfo($condition, $field = '*') {
  20. return $this->table('live_order')->field($field)->where($condition)->find();
  21. }
  22. /**
  23. * 线下抢购订单列表
  24. * @param array $condition
  25. * @param string $field
  26. * @param number $page
  27. * @param string $order
  28. */
  29. public function getList($condition = array(), $field = '*', $page='15', $order = 'order_id desc') {
  30. return $this->table('live_order')->where($condition)->page($page)->order($order)->select();
  31. }
  32. /**
  33. * 会员订单列表
  34. * @param array $condition
  35. * @param string $field
  36. * @param number $page
  37. * @param string $order
  38. */
  39. public function getOrderGroupbuy($condition = array(), $field = '*', $page='15', $order = 'order_id desc'){
  40. return $this->table('live_order,live_groupbuy')->field($field)->join('left')->on('live_order.item_id = live_groupbuy.groupbuy_id')->where($condition)->page($page)->order($order)->select();
  41. }
  42. /**
  43. * 操作日志
  44. * @param array $condition
  45. * @param string $field
  46. * @param number $page
  47. * @param string $order
  48. */
  49. public function getOrderVerifyLog($condition = array(), $field = '*', $page='15', $order = 'order_item_id desc'){
  50. return $this->table('live_order_pwd,live_order')->field($field)->join('left')->on('live_order_pwd.order_id=live_order.order_id')->where($condition)->page($page)->order($order)->select();
  51. }
  52. /**
  53. * 添加抢购订单
  54. * @param array $params
  55. */
  56. public function add($params){
  57. return $this->table('live_order')->insert($params);
  58. }
  59. /**
  60. * 更新订单
  61. * @param array $condition
  62. * @param array $params
  63. */
  64. public function updateLiveOrder($condition,$params){
  65. return $this->table('live_order')->where($condition)->update($params);
  66. }
  67. /**
  68. * 删除线下抢购订
  69. * @param array $condition
  70. */
  71. public function del($condition){
  72. return $this->table('live_order')->where($condition)->delete();
  73. }
  74. /**
  75. * 获取订单抢购券
  76. * @param array $condition
  77. */
  78. public function getLiveOrderPwd($condition){
  79. return $this->table('live_order_pwd')->where($condition)->select();
  80. }
  81. /**
  82. * 添加抢购券
  83. * @param array $params
  84. */
  85. public function addLiveOrderPwd($params){
  86. return $this->table('live_order_pwd')->insert($params);
  87. }
  88. }