|
@@ -1,51 +1,51 @@
|
|
|
-<?php
|
|
|
-
|
|
|
-use const mtopcard\PetroChinaCard;
|
|
|
-use const mtopcard\PhoneCard;
|
|
|
-use const mtopcard\SinopecCard;
|
|
|
-
|
|
|
-defined('InShopNC') or exit('Access Invalid!');
|
|
|
-
|
|
|
-
|
|
|
-class refill_orderModel extends Model
|
|
|
-{
|
|
|
- public function getOrderInfo($condition = [], $fields = '*', $master = false, $lock = false)
|
|
|
- {
|
|
|
- $order_info = $this->table('refill_order')->field($fields)->where($condition)->order('')->master($master)->lock($lock)->find();
|
|
|
- if (empty($order_info)) {
|
|
|
- return [];
|
|
|
- }
|
|
|
- return $order_info;
|
|
|
- }
|
|
|
-
|
|
|
- public function add_refill($params)
|
|
|
- {
|
|
|
- return $this->table('refill_order')->insert($params);
|
|
|
- }
|
|
|
-
|
|
|
- public function edit($order_id,$data)
|
|
|
- {
|
|
|
- return $this->table('refill_order')->where(['order_id' => $order_id])->update($data);
|
|
|
- }
|
|
|
-
|
|
|
- public function getMerchantOrderList($condition, $pagesize = '', $field = '*', $order = 'refill_order.order_id desc', $limit = '')
|
|
|
- {
|
|
|
- $list = $this->table('refill_order,vr_order')->field($field)
|
|
|
- ->where($condition)->join('inner')->on('refill_order.order_id=vr_order.order_id')->page($pagesize)->order($order)->limit($limit)->select();
|
|
|
- if (empty($list)) return [];
|
|
|
- return $list;
|
|
|
- }
|
|
|
-
|
|
|
- public function getOrderStatsList($condition, $pagesize = '', $field = '*', $order = 'time_stamp desc', $limit = '')
|
|
|
- {
|
|
|
- $list = $this->table('refill_stats')->field($field)
|
|
|
- ->where($condition)->page($pagesize)->order($order)->limit($limit)->select();
|
|
|
- if (empty($list)) return [];
|
|
|
- return $list;
|
|
|
- }
|
|
|
-
|
|
|
- public function first_item()
|
|
|
- {
|
|
|
- return $this->table('refill_order')->field('order_time')->where(['order_id' => ['gt',0]])->order('order_id asc')->find();
|
|
|
- }
|
|
|
-}
|
|
|
+<?php
|
|
|
+
|
|
|
+use const mtopcard\PetroChinaCard;
|
|
|
+use const mtopcard\PhoneCard;
|
|
|
+use const mtopcard\SinopecCard;
|
|
|
+
|
|
|
+defined('InShopNC') or exit('Access Invalid!');
|
|
|
+
|
|
|
+
|
|
|
+class refill_orderModel extends Model
|
|
|
+{
|
|
|
+ public function getOrderInfo($condition = [], $fields = '*', $master = false, $lock = false)
|
|
|
+ {
|
|
|
+ $order_info = $this->table('refill_order')->field($fields)->where($condition)->order('')->master($master)->lock($lock)->find();
|
|
|
+ if (empty($order_info)) {
|
|
|
+ return [];
|
|
|
+ }
|
|
|
+ return $order_info;
|
|
|
+ }
|
|
|
+
|
|
|
+ public function add_refill($params)
|
|
|
+ {
|
|
|
+ return $this->table('refill_order')->insert($params);
|
|
|
+ }
|
|
|
+
|
|
|
+ public function edit($order_id,$data)
|
|
|
+ {
|
|
|
+ return $this->table('refill_order')->where(['order_id' => $order_id])->update($data);
|
|
|
+ }
|
|
|
+
|
|
|
+ public function getMerchantOrderList($condition, $pagesize = '', $field = '*', $order = 'refill_order.order_id desc', $limit = '', $master = false)
|
|
|
+ {
|
|
|
+ $list = $this->table('refill_order,vr_order')->field($field)
|
|
|
+ ->where($condition)->join('inner')->on('refill_order.order_id=vr_order.order_id')->page($pagesize)->order($order)->limit($limit)->master($master)->select();
|
|
|
+ if (empty($list)) return [];
|
|
|
+ return $list;
|
|
|
+ }
|
|
|
+
|
|
|
+ public function getOrderStatsList($condition, $pagesize = '', $field = '*', $order = 'time_stamp desc', $limit = '')
|
|
|
+ {
|
|
|
+ $list = $this->table('refill_stats')->field($field)
|
|
|
+ ->where($condition)->page($pagesize)->order($order)->limit($limit)->select();
|
|
|
+ if (empty($list)) return [];
|
|
|
+ return $list;
|
|
|
+ }
|
|
|
+
|
|
|
+ public function first_item()
|
|
|
+ {
|
|
|
+ return $this->table('refill_order')->field('order_time')->where(['order_id' => ['gt',0]])->order('order_id asc')->find();
|
|
|
+ }
|
|
|
+}
|