Quellcode durchsuchen

调整页面限å显示问题

hefei vor 1 Jahr
Ursprung
Commit
599eee9b94

+ 5 - 1
app/common/repositories/store/order/StoreRefundOrderRepository.php

@@ -344,7 +344,11 @@ class StoreRefundOrderRepository extends BaseRepository
344
      */
344
      */
345
     public function getList(array $where, int $page, int $limit,$status)
345
     public function getList(array $where, int $page, int $limit,$status)
346
     {
346
     {
347
-        if($status == 2) $where['status'] = '1,2';
347
+        if($status == 2){
348
+            $where['status'] = '1,2';
349
+        }else{
350
+            $where['status'] = $status;
351
+        }
348
         $query = $this->dao->search($where)->where('is_system_del', 0)->with(['order' => function ($query) {
352
         $query = $this->dao->search($where)->where('is_system_del', 0)->with(['order' => function ($query) {
349
             $query->field('order_id,order_sn,douhuomall');
353
             $query->field('order_id,order_sn,douhuomall');
350
         }, 'refundProduct.product', 'user' => function ($query) {
354
         }, 'refundProduct.product', 'user' => function ($query) {

+ 49 - 49
app/controller/api/store/product/Other.php

@@ -161,14 +161,18 @@ class Other extends BaseController
161
         //1多多进宝2唯品会3苏宁易购4网易考拉5淘宝客6京东联盟7饿了么
161
         //1多多进宝2唯品会3苏宁易购4网易考拉5淘宝客6京东联盟7饿了么
162
         switch ($params['type']) {
162
         switch ($params['type']) {
163
             case 1://多多进宝
163
             case 1://多多进宝
164
-                $list = Db::name('order_pdd')
165
-                    ->field('order_pdd_id id,goods_id,goods_sign,order_sn,goods_num,goods_img,goods_name,goods_price,pin_order_status other_status,pin_order_status_desc other_status_desc,order_money,pay_money,create_time,commission,bill_status,bill_end_time')
164
+                $list = Db::name('user_bill')
165
+                    ->field('number,order_sn')
166
                     ->where('uid', $userId)
166
                     ->where('uid', $userId)
167
+                    ->where('commission_type',5)
167
                     ->where('create_time', '>', date('Y-m-d H:i:s', strtotime($startTime)))
168
                     ->where('create_time', '>', date('Y-m-d H:i:s', strtotime($startTime)))
168
                     ->where('create_time', '<', date('Y-m-d H:i:s', strtotime($endTime)))
169
                     ->where('create_time', '<', date('Y-m-d H:i:s', strtotime($endTime)))
169
-                    ->order('id', 'desc')
170
+                    ->order('bill_id', 'desc')
170
                     ->page($page, $limit)->select()
171
                     ->page($page, $limit)->select()
171
                     ->each(function ($value) {
172
                     ->each(function ($value) {
173
+                        $pdd_list = Db::name("order_pdd")->where("order_sn",$value['order_sn'])->field('order_pdd_id id,goods_id,goods_sign,order_sn,goods_num,goods_img,goods_name,goods_price,pin_order_status other_status,pin_order_status_desc other_status_desc,order_money,pay_money,create_time,commission,bill_status,bill_end_time');
174
+                        $value = array_merge($value,$pdd_list);
175
+                        $yanglao = $value['number'];
172
                         $value['source'] = 1;
176
                         $value['source'] = 1;
173
                         $billEndTime = $value['bill_end_time'];
177
                         $billEndTime = $value['bill_end_time'];
174
                         $value['bill_end_time'] = $billEndTime ? date('Y-m-d H:i:s', $billEndTime) : '';
178
                         $value['bill_end_time'] = $billEndTime ? date('Y-m-d H:i:s', $billEndTime) : '';
@@ -176,10 +180,6 @@ class Other extends BaseController
176
                         $statusName = ['未结算', '已结算', '失效'];
180
                         $statusName = ['未结算', '已结算', '失效'];
177
                         $value['status_name'] = $statusName[$value['bill_status']];
181
                         $value['status_name'] = $statusName[$value['bill_status']];
178
                         $commission = $value['commission'];
182
                         $commission = $value['commission'];
179
-                        $yanglao = 0;
180
-                        if ($commission) {
181
-                            $yanglao = Db::name("user_bill") -> where("order_sn",$value['order_sn']) -> value("number");
182
-                        }
183
                         if (!$yanglao|| $yanglao <= 0){
183
                         if (!$yanglao|| $yanglao <= 0){
184
                             $yanglao = app()->make(ProductRepository::class)->yanglaojin(0, $commission);
184
                             $yanglao = app()->make(ProductRepository::class)->yanglaojin(0, $commission);
185
                         }
185
                         }
@@ -188,14 +188,18 @@ class Other extends BaseController
188
                     });
188
                     });
189
                 break;
189
                 break;
190
             case 2://唯品会(没有商品价格)
190
             case 2://唯品会(没有商品价格)
191
-                $list = Db::name('order_vip')
192
-                    ->field('order_vip_id id,goods_id,order_sn,goods_count goods_num,goods_thumb goods_img,goods_name,order_status other_status_desc,order_time create_time,commission,bill_status,bill_end_time,pay_money')
191
+                $list = Db::name('user_bill')
192
+                    ->field('number,order_sn')
193
                     ->where('uid', $userId)
193
                     ->where('uid', $userId)
194
+                    ->where('commission_type',5)
194
                     ->where('create_time', '>', date('Y-m-d H:i:s', strtotime($startTime)))
195
                     ->where('create_time', '>', date('Y-m-d H:i:s', strtotime($startTime)))
195
                     ->where('create_time', '<', date('Y-m-d H:i:s', strtotime($endTime)))
196
                     ->where('create_time', '<', date('Y-m-d H:i:s', strtotime($endTime)))
196
-                    ->order('id', 'desc')
197
+                    ->order('bill_id', 'desc')
197
                     ->page($page, $limit)->select()
198
                     ->page($page, $limit)->select()
198
                     ->each(function ($value) {
199
                     ->each(function ($value) {
200
+                        $vip_list = Db::name("order_vip")->where("order_sn",$value['order_sn'])->field('order_vip_id id,goods_id,order_sn,goods_count goods_num,goods_thumb goods_img,goods_name,order_status other_status_desc,order_time create_time,commission,bill_status,bill_end_time,pay_money');
201
+                        $value = array_merge($value,$vip_list);
202
+                        $yanglao = $value['number'];
199
                         $value['source'] = 2;
203
                         $value['source'] = 2;
200
                         $billEndTime = $value['bill_end_time'];
204
                         $billEndTime = $value['bill_end_time'];
201
                         $value['bill_end_time'] = $billEndTime ? date('Y-m-d H:i:s', $billEndTime) : '';
205
                         $value['bill_end_time'] = $billEndTime ? date('Y-m-d H:i:s', $billEndTime) : '';
@@ -203,10 +207,6 @@ class Other extends BaseController
203
                         $statusName = ['未结算', '已结算', '失效'];
207
                         $statusName = ['未结算', '已结算', '失效'];
204
                         $value['status_name'] = $statusName[$value['bill_status']];
208
                         $value['status_name'] = $statusName[$value['bill_status']];
205
                         $commission = $value['commission'];
209
                         $commission = $value['commission'];
206
-                        $yanglao = 0;
207
-                        if ($commission) {
208
-                            $yanglao = Db::name("user_bill") -> where("order_sn",$value['order_sn']) -> value("number");
209
-                        }
210
                         if (!$yanglao|| $yanglao <= 0){
210
                         if (!$yanglao|| $yanglao <= 0){
211
                             $yanglao = app()->make(ProductRepository::class)->yanglaojin(0, $commission);
211
                             $yanglao = app()->make(ProductRepository::class)->yanglaojin(0, $commission);
212
                         }
212
                         }
@@ -215,14 +215,18 @@ class Other extends BaseController
215
                     });
215
                     });
216
                 break;
216
                 break;
217
             case 3://苏宁订单列表
217
             case 3://苏宁订单列表
218
-                $list = Db::name('order_su')
219
-                    ->field('order_su_id id,goods_id,order_sn,goods_count goods_num,goods_thumb goods_img,goods_name,status other_status_desc,order_time create_time,commission,bill_status,bill_end_time,pay_amount')
218
+                $list = Db::name('user_bill')
219
+                    ->field('number,order_sn')
220
                     ->where('uid', $userId)
220
                     ->where('uid', $userId)
221
+                    ->where('commission_type',5)
221
                     ->where('create_time', '>', date('Y-m-d H:i:s', strtotime($startTime)))
222
                     ->where('create_time', '>', date('Y-m-d H:i:s', strtotime($startTime)))
222
                     ->where('create_time', '<', date('Y-m-d H:i:s', strtotime($endTime)))
223
                     ->where('create_time', '<', date('Y-m-d H:i:s', strtotime($endTime)))
223
-                    ->order('id', 'desc')
224
+                    ->order('bill_id', 'desc')
224
                     ->page($page, $limit)->select()
225
                     ->page($page, $limit)->select()
225
                     ->each(function ($value) {
226
                     ->each(function ($value) {
227
+                        $su_list = Db::name("order_su")->where("order_sn",$value['order_sn'])->field('order_su_id id,goods_id,order_sn,goods_count goods_num,goods_thumb goods_img,goods_name,status other_status_desc,order_time create_time,commission,bill_status,bill_end_time,pay_amount');
228
+                        $value = array_merge($value,$su_list);
229
+                        $yanglao = $value['number'];
226
                         $value['source'] = 3;
230
                         $value['source'] = 3;
227
                         $billEndTime = $value['bill_end_time'];
231
                         $billEndTime = $value['bill_end_time'];
228
                         $value['bill_end_time'] = $billEndTime ? date('Y-m-d H:i:s', $billEndTime) : '';
232
                         $value['bill_end_time'] = $billEndTime ? date('Y-m-d H:i:s', $billEndTime) : '';
@@ -230,10 +234,6 @@ class Other extends BaseController
230
                         $statusName = ['未结算', '已结算', '失效'];
234
                         $statusName = ['未结算', '已结算', '失效'];
231
                         $value['status_name'] = $statusName[$value['bill_status']];
235
                         $value['status_name'] = $statusName[$value['bill_status']];
232
                         $commission = $value['commission'];
236
                         $commission = $value['commission'];
233
-                        $yanglao = 0;
234
-                        if ($commission) {
235
-                            $yanglao = Db::name("user_bill") -> where("order_sn",$value['order_sn']) -> value("number");
236
-                        }
237
                         if (!$yanglao|| $yanglao <= 0){
237
                         if (!$yanglao|| $yanglao <= 0){
238
                             $yanglao = app()->make(ProductRepository::class)->yanglaojin(0, $commission);
238
                             $yanglao = app()->make(ProductRepository::class)->yanglaojin(0, $commission);
239
                         }
239
                         }
@@ -242,14 +242,18 @@ class Other extends BaseController
242
                     });
242
                     });
243
                 break;
243
                 break;
244
             case 5://淘宝客
244
             case 5://淘宝客
245
-                $list = Db::name('order_tb')
246
-                    ->field('order_tb_id id,item_id goods_id,order_sn,item_num goods_num,item_img goods_img,item_title goods_name,item_price goods_price,tk_status,create_time,commission,commission_rate,alipay_total_price pay_money,bill_status,bill_end_time')
245
+                $list = Db::name('user_bill')
246
+                    ->field('number,order_sn')
247
                     ->where('uid', $userId)
247
                     ->where('uid', $userId)
248
+                    ->where('commission_type',5)
248
                     ->where('create_time', '>', date('Y-m-d H:i:s', strtotime($startTime)))
249
                     ->where('create_time', '>', date('Y-m-d H:i:s', strtotime($startTime)))
249
                     ->where('create_time', '<', date('Y-m-d H:i:s', strtotime($endTime)))
250
                     ->where('create_time', '<', date('Y-m-d H:i:s', strtotime($endTime)))
250
-                    ->order('id', 'desc')
251
+                    ->order('bill_id', 'desc')
251
                     ->page($page, $limit)->select()
252
                     ->page($page, $limit)->select()
252
                     ->each(function ($value) {
253
                     ->each(function ($value) {
254
+                        $tb_list = Db::name("order_tb")->where("order_sn",$value['order_sn'])->field('order_tb_id id,item_id goods_id,order_sn,item_num goods_num,item_img goods_img,item_title goods_name,item_price goods_price,tk_status,create_time,commission,commission_rate,alipay_total_price pay_money,bill_status,bill_end_time');
255
+                        $value = array_merge($value,$tb_list);
256
+                        $yanglao = $value['number'];
253
                         $otherStatus = $value['tk_status'];
257
                         $otherStatus = $value['tk_status'];
254
                         $value['other_status_desc'] = TbOrderModel::$statusName[$otherStatus] ?? '未知类型';
258
                         $value['other_status_desc'] = TbOrderModel::$statusName[$otherStatus] ?? '未知类型';
255
                         $value['source'] = 5;
259
                         $value['source'] = 5;
@@ -262,10 +266,6 @@ class Other extends BaseController
262
                         if ($commission == 0) {
266
                         if ($commission == 0) {
263
                             $commission = sprintf('%.2f', $value['commission_rate'] * $value['pay_money'] / 100);
267
                             $commission = sprintf('%.2f', $value['commission_rate'] * $value['pay_money'] / 100);
264
                         }
268
                         }
265
-                        $yanglao = 0;
266
-                        if ($commission) {
267
-                            $yanglao = Db::name("user_bill") -> where("order_sn",$value['order_sn']) -> value("number");
268
-                        }
269
                         if (!$yanglao|| $yanglao <= 0){
269
                         if (!$yanglao|| $yanglao <= 0){
270
                             $yanglao = app()->make(ProductRepository::class)->yanglaojin(0, $commission);
270
                             $yanglao = app()->make(ProductRepository::class)->yanglaojin(0, $commission);
271
                         }
271
                         }
@@ -277,14 +277,18 @@ class Other extends BaseController
277
                     });
277
                     });
278
                 break;
278
                 break;
279
             case 6://京东订单
279
             case 6://京东订单
280
-                $list = Db::name('order_jd')
281
-                    ->field('order_jd_id id,sku_id goods_id,order_sn,sku_num goods_num,image_url goods_img,sku_name goods_name,pay_money,price goods_price,status,create_time,commission,bill_status,bill_end_time')
280
+                $list = Db::name('user_bill')
281
+                    ->field('number,order_sn')
282
                     ->where('uid', $userId)
282
                     ->where('uid', $userId)
283
+                    ->where('commission_type',5)
283
                     ->where('create_time', '>', date('Y-m-d H:i:s', strtotime($startTime)))
284
                     ->where('create_time', '>', date('Y-m-d H:i:s', strtotime($startTime)))
284
                     ->where('create_time', '<', date('Y-m-d H:i:s', strtotime($endTime)))
285
                     ->where('create_time', '<', date('Y-m-d H:i:s', strtotime($endTime)))
285
-                    ->order('id', 'desc')
286
+                    ->order('bill_id', 'desc')
286
                     ->page($page, $limit)->select()
287
                     ->page($page, $limit)->select()
287
                     ->each(function ($value) {
288
                     ->each(function ($value) {
289
+                        $jd_list = Db::name("order_jd")->where("order_sn",$value['order_sn'])->field('order_jd_id id,sku_id goods_id,order_sn,sku_num goods_num,image_url goods_img,sku_name goods_name,pay_money,price goods_price,status,create_time,commission,bill_status,bill_end_time');
290
+                        $value = array_merge($value,$jd_list);
291
+                        $yanglao = $value['number'];
288
                         $otherStatus = $value['status'];
292
                         $otherStatus = $value['status'];
289
                         $value['other_status_desc'] = JdOrderModel::$statusName[$otherStatus] ?? '未知订单状态';
293
                         $value['other_status_desc'] = JdOrderModel::$statusName[$otherStatus] ?? '未知订单状态';
290
                         $value['source'] = 6;
294
                         $value['source'] = 6;
@@ -294,10 +298,6 @@ class Other extends BaseController
294
                         $statusName = ['未结算', '已结算', '失效'];
298
                         $statusName = ['未结算', '已结算', '失效'];
295
                         $value['status_name'] = $statusName[$value['bill_status']];
299
                         $value['status_name'] = $statusName[$value['bill_status']];
296
                         $commission = $value['commission'];
300
                         $commission = $value['commission'];
297
-                        $yanglao = 0;
298
-                        if ($commission) {
299
-                            $yanglao = Db::name("user_bill") -> where("order_sn",$value['order_sn']) -> value("number");
300
-                        }
301
                         if (!$yanglao|| $yanglao <= 0){
301
                         if (!$yanglao|| $yanglao <= 0){
302
                             $yanglao = app()->make(ProductRepository::class)->yanglaojin(0, $commission);
302
                             $yanglao = app()->make(ProductRepository::class)->yanglaojin(0, $commission);
303
                         }
303
                         }
@@ -306,14 +306,18 @@ class Other extends BaseController
306
                     });
306
                     });
307
                 break;
307
                 break;
308
             case 9: //抖音
308
             case 9: //抖音
309
-                $list = Db::name('order_dy')
310
-                    ->field('order_dy_id id,product_id goods_id,order_sn,product_num goods_num,product_img goods_img,product_name goods_name,commission,total_pay_amount pay_money,bill_status,bill_end_time,create_time,flow_point status,pay_success_time')
309
+                $list = Db::name('user_bill')
310
+                    ->field('number,order_sn')
311
                     ->where('uid', $userId)
311
                     ->where('uid', $userId)
312
+                    ->where('commission_type',5)
312
                     ->where('pay_success_time', '>', date('Y-m-d H:i:s', strtotime($startTime)))
313
                     ->where('pay_success_time', '>', date('Y-m-d H:i:s', strtotime($startTime)))
313
                     ->where('pay_success_time', '<', date('Y-m-d H:i:s', strtotime($endTime)))
314
                     ->where('pay_success_time', '<', date('Y-m-d H:i:s', strtotime($endTime)))
314
-                    ->order('id', 'desc')
315
+                    ->order('bill_id', 'desc')
315
                     ->page($page, $limit)->select()
316
                     ->page($page, $limit)->select()
316
                     ->each(function ($value) {
317
                     ->each(function ($value) {
318
+                        $dy_list = Db::name("order_dy")->where("order_sn",$value['order_sn'])->field('order_dy_id id,product_id goods_id,order_sn,product_num goods_num,product_img goods_img,product_name goods_name,commission,total_pay_amount pay_money,bill_status,bill_end_time,create_time,flow_point status,pay_success_time')->find();
319
+                        $value = array_merge($value,$dy_list);
320
+                        $yanglao = $value['number'];
317
                         $otherStatus = $value['status'];
321
                         $otherStatus = $value['status'];
318
                         $value['other_status_desc'] = DyOrderModel::$statusName[$otherStatus] ?? '未知订单状态';
322
                         $value['other_status_desc'] = DyOrderModel::$statusName[$otherStatus] ?? '未知订单状态';
319
                         $value['source'] = 9;
323
                         $value['source'] = 9;
@@ -323,10 +327,6 @@ class Other extends BaseController
323
                         $statusName = ['未结算', '已结算', '失效'];
327
                         $statusName = ['未结算', '已结算', '失效'];
324
                         $value['status_name'] = $statusName[$value['bill_status']];
328
                         $value['status_name'] = $statusName[$value['bill_status']];
325
                         $commission = $value['commission'];
329
                         $commission = $value['commission'];
326
-                        $yanglao = 0;
327
-                        if ($commission) {
328
-                            $yanglao = Db::name("user_bill") -> where("order_sn",$value['order_sn']) -> value("number");
329
-                        }
330
                         if (!$yanglao|| $yanglao <= 0){
330
                         if (!$yanglao|| $yanglao <= 0){
331
                             $yanglao = app()->make(ProductRepository::class)->yanglaojin(0, $commission);
331
                             $yanglao = app()->make(ProductRepository::class)->yanglaojin(0, $commission);
332
                         }
332
                         }
@@ -335,14 +335,17 @@ class Other extends BaseController
335
                     });
335
                     });
336
                 break;
336
                 break;
337
             case 10: //话费
337
             case 10: //话费
338
-                $list = Db::name('order_huafei')
339
-                    ->field('order_huafei_id id,order_sn,commission,amount_price pay_money,bill_status,bill_end_time,create_time,finish_time')
338
+                $list = Db::name('user_bill')
339
+                    ->field('number,order_sn')
340
                     ->where('uid', $userId)
340
                     ->where('uid', $userId)
341
+                    ->where('commission_type',5)
341
                     ->where('create_time', '>', date('Y-m-d H:i:s', strtotime($startTime)))
342
                     ->where('create_time', '>', date('Y-m-d H:i:s', strtotime($startTime)))
342
                     ->where('create_time', '<', date('Y-m-d H:i:s', strtotime($endTime)))
343
                     ->where('create_time', '<', date('Y-m-d H:i:s', strtotime($endTime)))
343
-                    ->order('id', 'desc')
344
+                    ->order('bill_id', 'desc')
344
                     ->page($page, $limit)->select()
345
                     ->page($page, $limit)->select()
345
                     ->each(function ($value) {
346
                     ->each(function ($value) {
347
+                        $huafei_list = Db::name("order_huafei")->where("order_sn",$value['order_sn'])->field('order_huafei_id id,order_sn,commission,amount_price pay_money,bill_status,bill_end_time,create_time,finish_time')->find();
348
+                        $value = array_merge($value,$huafei_list);
346
                         $value['source'] = 10;
349
                         $value['source'] = 10;
347
                         $billEndTime = $value['bill_end_time'];
350
                         $billEndTime = $value['bill_end_time'];
348
                         $value['bill_end_time'] = $billEndTime ? date('Y-m-d H:i:s', $billEndTime) : '';
351
                         $value['bill_end_time'] = $billEndTime ? date('Y-m-d H:i:s', $billEndTime) : '';
@@ -350,10 +353,7 @@ class Other extends BaseController
350
                         $statusName = ['未结算', '已结算', '失效'];
353
                         $statusName = ['未结算', '已结算', '失效'];
351
                         $value['status_name'] = $statusName[$value['bill_status']];
354
                         $value['status_name'] = $statusName[$value['bill_status']];
352
                         $commission = $value['commission'];
355
                         $commission = $value['commission'];
353
-                        $yanglao = 0;
354
-                        if ($commission) {
355
-                            $yanglao = Db::name("user_bill")->where("order_sn",$value['order_sn']) -> value("number");
356
-                        }
356
+                        $yanglao = $value['number'];
357
                         if (!$yanglao|| $yanglao <= 0){
357
                         if (!$yanglao|| $yanglao <= 0){
358
                             $systemvalueObj = Db::name('system_config_value')->where('config_key','sanfangfenpei')->find();
358
                             $systemvalueObj = Db::name('system_config_value')->where('config_key','sanfangfenpei')->find();
359
                             $sanfangfenpei=json_decode($systemvalueObj['value'],true);
359
                             $sanfangfenpei=json_decode($systemvalueObj['value'],true);

+ 1 - 1
app/controller/merchant/store/order/RefundOrder.php

@@ -44,7 +44,7 @@ class RefundOrder extends BaseController
44
     {
44
     {
45
         list($page,$limit) = $this->getPage();
45
         list($page,$limit) = $this->getPage();
46
         $where = $this->request->params(['refund_order_sn','refund_type','date','order_sn']);
46
         $where = $this->request->params(['refund_order_sn','refund_type','date','order_sn']);
47
-        $status = $this->request->params('status');
47
+        $status = $this->request->param('status');
48
         $where['mer_id'] = $this->request->merId();
48
         $where['mer_id'] = $this->request->merId();
49
         return app('json')->success($this->repository->getList($where,$page,$limit,$status));
49
         return app('json')->success($this->repository->getList($where,$page,$limit,$status));
50
     }
50
     }