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