hefei 1 年間 前
コミット
229e970760
共有1 個のファイルを変更した20 個の追加14 個の削除を含む
  1. 20 14
      app/controller/api/store/product/Other.php

+ 20 - 14
app/controller/api/store/product/Other.php

@@ -26,6 +26,12 @@ class Other extends BaseController
26
     protected $app;
26
     protected $app;
27
     protected $userThird;
27
     protected $userThird;
28
     protected $uid;
28
     protected $uid;
29
+    // 养老金表奖励状态
30
+    public $statusName = [
31
+        0 => '未结算',
32
+        1 => '已结算',
33
+        -1 => '失效'
34
+    ];
29
 
35
 
30
     public function __construct(App $app)
36
     public function __construct(App $app)
31
     {
37
     {
@@ -389,7 +395,7 @@ class Other extends BaseController
389
         switch ($params['type']) {
395
         switch ($params['type']) {
390
             case 1://多多进宝
396
             case 1://多多进宝
391
                 $list = Db::name('user_bill')
397
                 $list = Db::name('user_bill')
392
-                    ->field('number,order_sn')
398
+                    ->field('number,order_sn,status')
393
                     ->where('uid', $userId)
399
                     ->where('uid', $userId)
394
                     ->where('commission_type',5)
400
                     ->where('commission_type',5)
395
                     ->where('create_time', '>', date('Y-m-d H:i:s', strtotime($startTime)))
401
                     ->where('create_time', '>', date('Y-m-d H:i:s', strtotime($startTime)))
@@ -413,7 +419,7 @@ class Other extends BaseController
413
                         $value['bill_end_time'] = $billEndTime ? date('Y-m-d H:i:s', $billEndTime) : '';
419
                         $value['bill_end_time'] = $billEndTime ? date('Y-m-d H:i:s', $billEndTime) : '';
414
                         //'0平台未结算1已结算2失效
420
                         //'0平台未结算1已结算2失效
415
                         $statusName = ['未结算', '已结算', '失效'];
421
                         $statusName = ['未结算', '已结算', '失效'];
416
-                        $value['status_name'] = $statusName[$value['bill_status']];
422
+                        $value['status_name'] = $this->statusName[$value['status']];
417
                         $commission = $value['commission'];
423
                         $commission = $value['commission'];
418
                         if (!$yanglao|| $yanglao <= 0){
424
                         if (!$yanglao|| $yanglao <= 0){
419
                             $yanglao = app()->make(ProductRepository::class)->yanglaojin(0, $commission);
425
                             $yanglao = app()->make(ProductRepository::class)->yanglaojin(0, $commission);
@@ -424,7 +430,7 @@ class Other extends BaseController
424
                 break;
430
                 break;
425
             case 2://唯品会(没有商品价格)
431
             case 2://唯品会(没有商品价格)
426
                 $list = Db::name('user_bill')
432
                 $list = Db::name('user_bill')
427
-                    ->field('number,order_sn')
433
+                    ->field('number,order_sn,status')
428
                     ->where('uid', $userId)
434
                     ->where('uid', $userId)
429
                     ->where('commission_type',5)
435
                     ->where('commission_type',5)
430
                     ->where('create_time', '>', date('Y-m-d H:i:s', strtotime($startTime)))
436
                     ->where('create_time', '>', date('Y-m-d H:i:s', strtotime($startTime)))
@@ -448,7 +454,7 @@ class Other extends BaseController
448
                         $value['bill_end_time'] = $billEndTime ? date('Y-m-d H:i:s', $billEndTime) : '';
454
                         $value['bill_end_time'] = $billEndTime ? date('Y-m-d H:i:s', $billEndTime) : '';
449
                         //'0平台未结算1已结算2失效
455
                         //'0平台未结算1已结算2失效
450
                         $statusName = ['未结算', '已结算', '失效'];
456
                         $statusName = ['未结算', '已结算', '失效'];
451
-                        $value['status_name'] = $statusName[$value['bill_status']];
457
+                        $value['status_name'] = $this->statusName[$value['status']];
452
                         $commission = $value['commission'];
458
                         $commission = $value['commission'];
453
                         if (!$yanglao|| $yanglao <= 0){
459
                         if (!$yanglao|| $yanglao <= 0){
454
                             $yanglao = app()->make(ProductRepository::class)->yanglaojin(0, $commission);
460
                             $yanglao = app()->make(ProductRepository::class)->yanglaojin(0, $commission);
@@ -458,7 +464,7 @@ class Other extends BaseController
458
                 break;
464
                 break;
459
             case 3://苏宁订单列表
465
             case 3://苏宁订单列表
460
                 $list = Db::name('user_bill')
466
                 $list = Db::name('user_bill')
461
-                    ->field('number,order_sn')
467
+                    ->field('number,order_sn,status')
462
                     ->where('uid', $userId)
468
                     ->where('uid', $userId)
463
                     ->where('commission_type',5)
469
                     ->where('commission_type',5)
464
                     ->where('create_time', '>', date('Y-m-d H:i:s', strtotime($startTime)))
470
                     ->where('create_time', '>', date('Y-m-d H:i:s', strtotime($startTime)))
@@ -481,7 +487,7 @@ class Other extends BaseController
481
                         $value['bill_end_time'] = $billEndTime ? date('Y-m-d H:i:s', $billEndTime) : '';
487
                         $value['bill_end_time'] = $billEndTime ? date('Y-m-d H:i:s', $billEndTime) : '';
482
                         //'0平台未结算1已结算2失效
488
                         //'0平台未结算1已结算2失效
483
                         $statusName = ['未结算', '已结算', '失效'];
489
                         $statusName = ['未结算', '已结算', '失效'];
484
-                        $value['status_name'] = $statusName[$value['bill_status']];
490
+                        $value['status_name'] = $this->statusName[$value['status']];
485
                         $commission = $value['commission'];
491
                         $commission = $value['commission'];
486
                         if (!$yanglao|| $yanglao <= 0){
492
                         if (!$yanglao|| $yanglao <= 0){
487
                             $yanglao = app()->make(ProductRepository::class)->yanglaojin(0, $commission);
493
                             $yanglao = app()->make(ProductRepository::class)->yanglaojin(0, $commission);
@@ -491,7 +497,7 @@ class Other extends BaseController
491
                 break;
497
                 break;
492
             case 5://淘宝客
498
             case 5://淘宝客
493
                 $list = Db::name('user_bill')
499
                 $list = Db::name('user_bill')
494
-                    ->field('number,order_sn')
500
+                    ->field('number,order_sn,status')
495
                     ->where('uid', $userId)
501
                     ->where('uid', $userId)
496
                     ->where('commission_type',5)
502
                     ->where('commission_type',5)
497
                     ->where('create_time', '>', date('Y-m-d H:i:s', strtotime($startTime)))
503
                     ->where('create_time', '>', date('Y-m-d H:i:s', strtotime($startTime)))
@@ -516,7 +522,7 @@ class Other extends BaseController
516
                         $value['bill_end_time'] = $billEndTime ? date('Y-m-d H:i:s', $billEndTime) : '';
522
                         $value['bill_end_time'] = $billEndTime ? date('Y-m-d H:i:s', $billEndTime) : '';
517
                         //'0平台未结算1已结算2失效
523
                         //'0平台未结算1已结算2失效
518
                         $statusName = ['未结算', '已结算', '失效'];
524
                         $statusName = ['未结算', '已结算', '失效'];
519
-                        $value['status_name'] = $statusName[$value['bill_status']];
525
+                        $value['status_name'] = $this->statusName[$value['status']];
520
                         $commission = $value['commission'];
526
                         $commission = $value['commission'];
521
                         if ($commission == 0) {
527
                         if ($commission == 0) {
522
                             $commission = sprintf('%.2f', $value['commission_rate'] * $value['pay_money'] / 100);
528
                             $commission = sprintf('%.2f', $value['commission_rate'] * $value['pay_money'] / 100);
@@ -532,7 +538,7 @@ class Other extends BaseController
532
                 break;
538
                 break;
533
             case 6://京东订单
539
             case 6://京东订单
534
                 $list = Db::name('user_bill')
540
                 $list = Db::name('user_bill')
535
-                    ->field('number,order_sn')
541
+                    ->field('number,order_sn,status')
536
                     ->where('uid', $userId)
542
                     ->where('uid', $userId)
537
                     ->where('commission_type',5)
543
                     ->where('commission_type',5)
538
                     ->where('create_time', '>', date('Y-m-d H:i:s', strtotime($startTime)))
544
                     ->where('create_time', '>', date('Y-m-d H:i:s', strtotime($startTime)))
@@ -558,7 +564,7 @@ class Other extends BaseController
558
                         $value['bill_end_time'] = $billEndTime ? date('Y-m-d H:i:s', $billEndTime) : '';
564
                         $value['bill_end_time'] = $billEndTime ? date('Y-m-d H:i:s', $billEndTime) : '';
559
                         //'0平台未结算1已结算2失效
565
                         //'0平台未结算1已结算2失效
560
                         $statusName = ['未结算', '已结算', '失效'];
566
                         $statusName = ['未结算', '已结算', '失效'];
561
-                        $value['status_name'] = $statusName[$value['bill_status']];
567
+                        $value['status_name'] = $this->statusName[$value['status']];
562
                         $commission = $value['commission'];
568
                         $commission = $value['commission'];
563
                         if (!$yanglao|| $yanglao <= 0){
569
                         if (!$yanglao|| $yanglao <= 0){
564
                             $yanglao = app()->make(ProductRepository::class)->yanglaojin(0, $commission);
570
                             $yanglao = app()->make(ProductRepository::class)->yanglaojin(0, $commission);
@@ -568,7 +574,7 @@ class Other extends BaseController
568
                 break;
574
                 break;
569
             case 9: //抖音
575
             case 9: //抖音
570
                 $list = Db::name('user_bill')
576
                 $list = Db::name('user_bill')
571
-                    ->field('number,order_sn')
577
+                    ->field('number,order_sn,status')
572
                     ->where('uid', $userId)
578
                     ->where('uid', $userId)
573
                     ->where('commission_type',5)
579
                     ->where('commission_type',5)
574
                     ->where('pay_success_time', '>', date('Y-m-d H:i:s', strtotime($startTime)))
580
                     ->where('pay_success_time', '>', date('Y-m-d H:i:s', strtotime($startTime)))
@@ -594,7 +600,7 @@ class Other extends BaseController
594
                         $value['bill_end_time'] = $billEndTime ? date('Y-m-d H:i:s', $billEndTime) : '';
600
                         $value['bill_end_time'] = $billEndTime ? date('Y-m-d H:i:s', $billEndTime) : '';
595
                         //'0平台未结算1已结算2失效
601
                         //'0平台未结算1已结算2失效
596
                         $statusName = ['未结算', '已结算', '失效'];
602
                         $statusName = ['未结算', '已结算', '失效'];
597
-                        $value['status_name'] = $statusName[$value['bill_status']];
603
+                        $value['status_name'] = $this->statusName[$value['status']];
598
                         $commission = $value['commission'];
604
                         $commission = $value['commission'];
599
                         if (!$yanglao|| $yanglao <= 0){
605
                         if (!$yanglao|| $yanglao <= 0){
600
                             $yanglao = app()->make(ProductRepository::class)->yanglaojin(0, $commission);
606
                             $yanglao = app()->make(ProductRepository::class)->yanglaojin(0, $commission);
@@ -604,7 +610,7 @@ class Other extends BaseController
604
                 break;
610
                 break;
605
             case 10: //话费
611
             case 10: //话费
606
                 $list = Db::name('user_bill')
612
                 $list = Db::name('user_bill')
607
-                    ->field('number,order_sn')
613
+                    ->field('number,order_sn,status')
608
                     ->where('uid', $userId)
614
                     ->where('uid', $userId)
609
                     ->where('commission_type',5)
615
                     ->where('commission_type',5)
610
                     ->where('create_time', '>', date('Y-m-d H:i:s', strtotime($startTime)))
616
                     ->where('create_time', '>', date('Y-m-d H:i:s', strtotime($startTime)))
@@ -627,7 +633,7 @@ class Other extends BaseController
627
                     $value['bill_end_time'] = $billEndTime ? date('Y-m-d H:i:s', $billEndTime) : '';
633
                     $value['bill_end_time'] = $billEndTime ? date('Y-m-d H:i:s', $billEndTime) : '';
628
                     //'0平台未结算1已结算2失效
634
                     //'0平台未结算1已结算2失效
629
                     $statusName = ['未结算', '已结算', '失效'];
635
                     $statusName = ['未结算', '已结算', '失效'];
630
-                    $value['status_name'] = $statusName[$value['bill_status']];
636
+                    $value['status_name'] = $this->statusName[$value['status']];
631
                     $commission = $value['commission'];
637
                     $commission = $value['commission'];
632
                     $yanglao = $value['number'];
638
                     $yanglao = $value['number'];
633
                     if (!$yanglao|| $yanglao <= 0){
639
                     if (!$yanglao|| $yanglao <= 0){