Selaa lähdekoodia

æ›ç§修改三方订单问题

hefei 1 vuosi sitten
vanhempi
commit
b2b5345e3c

+ 0 - 3
app/command/PensionTasks.php

@@ -129,9 +129,6 @@ class PensionTasks extends Command
129 129
                     default:
130 130
                         $online = Db::table('rrx_store_order')->where('uid', $bill['uid'])->where('order_sn', $bill['order_sn'])->where('paid', 1)->find();
131 131
                 }
132
-                if($bill['uid'] == 1611){
133
-                    var_dump($online);die;
134
-                }
135 132
                 if (!$online) {
136 133
                     Log::info($bill['uid'] . '查询不到订单');
137 134
                     continue;

+ 76 - 1
app/common/repositories/user/UserRepository.php

@@ -884,7 +884,7 @@ class UserRepository extends BaseRepository
884 884
                         'uid' => $user['id'],
885 885
                         'reward_socre' => $num,
886 886
                         'status' => 1,
887
-                        'mark' => $mark ?? '管理员增加pv值',
887
+                        'mark' => $mark ?? '管理员增加积分',
888 888
                         'addtime' => time(),
889 889
                         'surplus' => $user['score'],
890 890
                         'settlement_time' => date('Y-m-d H:i:s'),
@@ -902,15 +902,90 @@ class UserRepository extends BaseRepository
902 902
                     break;
903 903
                 // 复购金
904 904
                 case 4:
905
+                    $isert_data = [
906
+                        'uid' => $user['id'],
907
+                        'number' => $num,
908
+                        'status' => 1,
909
+                        'mark' => $mark ?? '管理员增加复购金',
910
+                        'addtime' => time(),
911
+                        'surplus' => $user['fugou'],
912
+                        'settlement_time' => date('Y-m-d H:i:s'),
913
+                    ];
914
+                    if($award_type == 1){
915
+                        // 增加
916
+                        $isert_data['type'] = 1;
917
+                        Db::name('user')->inc('fugou', $num)->update();
918
+                    }else{
919
+                        // 减少
920
+                        $isert_data['type'] = 2;
921
+                        Db::name('user')->dec('fugou', $num)->update();
922
+                    }
923
+                    Db::name('user_sign_fugou')->insert($isert_data);
905 924
                     break;
906 925
                 // 红包
907 926
                 case 5:
927
+                    $isert_data = [
928
+                        'uid' => $user['id'],
929
+                        'number' => $num,
930
+                        'status' => 1,
931
+                        'mark' => $mark ?? '管理员增加红包',
932
+                        'addtime' => time(),
933
+                        'surplus' => $user['hongbao'],
934
+                        'settlement_time' => date('Y-m-d H:i:s'),
935
+                    ];
936
+                    if($award_type == 1){
937
+                        // 增加
938
+                        $isert_data['type'] = 1;
939
+                        Db::name('user')->inc('hongbao', $num)->update();
940
+                    }else{
941
+                        // 减少
942
+                        $isert_data['type'] = 2;
943
+                        Db::name('user')->dec('hongbao', $num)->update();
944
+                    }
945
+                    Db::name('user_sign_hongbao')->insert($isert_data);
908 946
                     break;
909 947
                 // 贡献值
910 948
                 case 8:
949
+                    $isert_data = [
950
+                        'uid' => $user['id'],
951
+                        'number' => $num,
952
+                        'status' => 1,
953
+                        'mark' => $mark ?? '管理员增加贡献值',
954
+                        'addtime' => time(),
955
+                        'surplus' => $user['contribute'],
956
+                        'settlement_time' => date('Y-m-d H:i:s'),
957
+                    ];
958
+                    if($award_type == 1){
959
+                        // 增加
960
+                        $isert_data['type'] = 1;
961
+                        Db::name('user')->inc('contribute', $num)->update();
962
+                    }else{
963
+                        // 减少
964
+                        $isert_data['type'] = 2;
965
+                        Db::name('user')->dec('contribute', $num)->update();
966
+                    }
967
+                    Db::name('user_sign_gongxian')->insert($isert_data);
911 968
                     break;
912 969
                 // vr
913 970
                 case 9:
971
+                    $isert_data = [
972
+                        'uid' => $user['id'],
973
+                        'number' => $num,
974
+                        'mark' => $mark ?? '管理员增加贡献值',
975
+                        'addtime' => time(),
976
+                        'surplus' => $user['vr'],
977
+                        'settlement_time' => date('Y-m-d H:i:s'),
978
+                    ];
979
+                    if($award_type == 1){
980
+                        // 增加
981
+                        $isert_data['type'] = 1;
982
+                        Db::name('user')->inc('vr', $num)->update();
983
+                    }else{
984
+                        // 减少
985
+                        $isert_data['type'] = 2;
986
+                        Db::name('user')->dec('vr', $num)->update();
987
+                    }
988
+                    Db::name('user_sign_vr')->insert($isert_data);
914 989
                     break;
915 990
                 // 京豆
916 991
                 case 10:

+ 8 - 8
app/common/repositories/user/UserThirdRepository.php

@@ -747,7 +747,7 @@ class UserThirdRepository extends BaseRepository
747 747
     /**
748 748
      * 添加预估积分记录
749 749
      */
750
-    public function yuguJifen($price,$user_id,$order_sn,$type_shop)
750
+    public function yuguJifen($order_id,$price,$user_id,$order_sn,$type_shop)
751 751
     {
752 752
         if (empty($user_id)) {
753 753
             Db::name('log')->insert(['data' => "type_shop:{$type_shop}, $order_sn, $order_sn, 赠送积分, 不存在用户ID"]);
@@ -757,7 +757,7 @@ class UserThirdRepository extends BaseRepository
757 757
         $user_sign_score_list = Db::name('user_sign_score')
758 758
             ->where('uid', $user_id)
759 759
             ->where('order_type', $type_shop)
760
-            ->where('order_id', $order_sn)
760
+            ->where('order_id', $order_id)
761 761
             ->find();
762 762
         if (!empty($user_sign_score_list)) {
763 763
             Db::name('log')->insert(['data' => "type_shop:{$type_shop}, $order_sn, $order_sn, 赠送积分, 订单已存在积分发放记录"]);
@@ -805,7 +805,7 @@ class UserThirdRepository extends BaseRepository
805 805
                 "addtime"       =>  time(),
806 806
                 "status"        =>  -1,
807 807
                 "order_type"    =>  $type_shop,
808
-                "order_id"      =>  $order_sn,
808
+                "order_id"      =>  $order_id,
809 809
                 "mark"          =>  "购买{$make}商品赠送积分",
810 810
                 "surplus"       =>  $surplus,
811 811
                 "pm"            =>  1,
@@ -823,7 +823,7 @@ class UserThirdRepository extends BaseRepository
823 823
                 "addtime"       =>time(),
824 824
                 "status"        =>-1,
825 825
                 "order_type"    =>$type_shop,
826
-                "order_id"      =>$order_sn,
826
+                "order_id"      =>$order_id,
827 827
                 "mark"          =>"购买{$make}商品赠送贡献值",
828 828
                 "desc"          =>'',
829 829
                 "surplus"       =>$surplusgongxian+$gxzongwei,
@@ -839,7 +839,7 @@ class UserThirdRepository extends BaseRepository
839 839
                 "addtime"       =>time(),
840 840
                 "status"        =>-1,
841 841
                 "order_type"    =>$type_shop,
842
-                "order_id"      =>$order_sn,
842
+                "order_id"      =>$order_id,
843 843
                 "mark"          =>"购买{$make}商品获得的PV",
844 844
             ];
845 845
             Db::name("user_pv_log")->insert($pv_data);//添加pv记录
@@ -854,7 +854,7 @@ class UserThirdRepository extends BaseRepository
854 854
                     "addtime"       =>time(),
855 855
                     "status"        =>-1,
856 856
                     "order_type"    =>$type_shop,
857
-                    "order_id"      =>$order_sn,
857
+                    "order_id"      =>$order_id,
858 858
                     "mark"          =>"购买{$make}商品赠送红包",
859 859
                     "desc"          =>'',
860 860
                     "surplus"       =>$hongbao,
@@ -884,7 +884,7 @@ class UserThirdRepository extends BaseRepository
884 884
                     "addtime"       =>  time(),
885 885
                     "status"        =>  -1,
886 886
                     "order_type"    =>  $type_shop,
887
-                    "order_id"      =>  $order_sn,
887
+                    "order_id"      =>  $order_id,
888 888
                     "mark"          =>  "推广{$make}商品赠送积分",
889 889
                     "surplus"       =>  $sprerdUser['score'] + $tuiguanyongjin,
890 890
                     "pm"            =>  1,
@@ -904,7 +904,7 @@ class UserThirdRepository extends BaseRepository
904 904
                     "addtime"       =>time(),
905 905
                     "status"        =>-1,
906 906
                     "order_type"    =>$type_shop,
907
-                    "order_id"      =>$order_sn,
907
+                    "order_id"      =>$order_id,
908 908
                     "mark"          =>"推广{$make}商品赠送贡献值",
909 909
                     "desc"          =>'',
910 910
                     "surplus"       => $sprerdUser['contribute'] + $gongxian,

+ 1 - 0
app/controller/api/store/product/DaTaoKe.php

@@ -389,6 +389,7 @@ class DaTaoKe
389 389
                 //预估积分
390 390
                 log::info("===待进入积分");
391 391
                 $orderThird->yuguJifen(
392
+                    $localOrder['order_tb_id'],
392 393
                     $localOrder['commission'],
393 394
                     $localOrder['uid'],
394 395
                     $localOrder['order_sn'],

+ 1 - 0
app/controller/api/store/product/Jd.php

@@ -623,6 +623,7 @@ class Jd extends BaseController
623 623
                     'order_jd');
624 624
                 //预估积分
625 625
                 $orderThird->yuguJifen(
626
+                    $order['jd_id'],
626 627
                     $order['commission'],
627 628
                     $order['uid'],
628 629
                     $order['order_sn'],

+ 1 - 0
app/controller/api/store/product/Jt.php

@@ -834,6 +834,7 @@ class Jt extends BaseController
834 834
                 $yanglaojin = $yanglaojin_order['extension_one'] ?? 0;
835 835
                 //预估积分
836 836
                 $orderThird->yuguJifen(
837
+                    $localOrder['order_jd_id'],
837 838
                     $localOrder['commission'],
838 839
                     $localOrder['uid'],
839 840
                     $localOrder['order_sn'],

+ 1 - 0
app/controller/api/store/product/Su.php

@@ -777,6 +777,7 @@ class Su extends BaseController
777 777
                     'order_su');
778 778
                 //预估积分
779 779
                 $orderThird->yuguJifen(
780
+                    $localOrder['order_jd_id'],
780 781
                     $order['commission'],
781 782
                     $order['uid'],
782 783
                     $order['order_sn'],

+ 1 - 0
app/controller/api/store/product/TaoKe.php

@@ -910,6 +910,7 @@ class TaoKe extends BaseController
910 910
                     'order_pdd');
911 911
                 //预估积分
912 912
                 $orderThird->yuguJifen(
913
+                    $localOrder['order_pdd_id'],
913 914
                     $localOrder['commission'] ,
914 915
                     $localOrder['uid'],
915 916
                     $localOrder['order_sn'],

+ 1 - 0
app/controller/api/store/product/Vip.php

@@ -914,6 +914,7 @@ class Vip extends BaseController
914 914
                     'order_vip');
915 915
                 //预估积分
916 916
                 $orderThird->yuguJifen(
917
+                    $localOrder['order_vip_id'],
917 918
                     $localOrder['commission'],
918 919
                     $localOrder['uid'],
919 920
                     $localOrder['order_sn'],