xialei 1 год назад
Родитель
Сommit
20e16e3451

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

@@ -2616,7 +2616,7 @@ class UserRepository extends BaseRepository
2616 2616
                     if(empty($item['product'])){
2617 2617
                         $item['product']=[
2618 2618
                             'product'=>[
2619
-                                'image'=>'http://app.bjtdba.com/uploads/def/20210326/e91a34629fefb65170071c2d45a623ac.jpg',
2619
+                                'image'=>'https://cdn.bjtdba.com/vod/image/2025-01-21/20250121180855764.png',
2620 2620
                                 'store_name'=>'商家年费'
2621 2621
                             ]
2622 2622
                         ];

+ 6 - 1
app/controller/api/Notify.php

@@ -63,7 +63,7 @@ class Notify
63 63
                             }
64 64
                             //话费充值支付成功推送
65 65
                             try{
66
-                                $push = app()->make(Huafei::class)->pushHf($order_data['uid'], $order_data['order_no'], $order_data['mobile'], $order_data['pay_price']);
66
+                                $push = app()->make(Huafei::class)->pushHf($order_data['uid'], $order_data['order_no'], $order_data['mobile'], $order_data['pay_price'], $order_data['order_id']);
67 67
                                 if($push['code'] != '0000'){
68 68
                                     $pay_wx = systemConfig('pay_wx');
69 69
                                     //推送失败 给新支付的这一笔退款
@@ -82,6 +82,11 @@ class Notify
82 82
                                     ];
83 83
                                     $hf_refund_res = app()->make(StoreRefundOrderRepository::class)->payment_Reverse($refund_traits, $pay_type == '1' ? 2 : 1, $pay_wx, $key);
84 84
                                     Db::name('log')->insert(['data'=>'话费充值汇付支付撤销返回结果:'.json_encode($hf_refund_res)]);
85
+                                    //把赠送出去的养老金 积分 贡献值 复购金 改为已失效
86
+                                    Db::name('user_bill')->where('order_sn', $order_data['order_no'])->update(['status'=> -1]);
87
+                                    Db::name('user_sign_score')->where('order_id', $order_data['order_no'])->update(['status'=> 0]);
88
+                                    Db::name('user_sign_gongxian')->where('order_id', $order_data['order_no'])->update(['status'=> 0]);
89
+                                    Db::name('user_sign_fugou')->where('order_id', $order_data['order_no'])->update(['status'=> 0]);
85 90
                                 }
86 91
                             }catch (\Exception $e) {
87 92
                                 Db::name('log')->insert(['data'=>'话费充值支付回调推送订单错误:'.$e->getFile().':'.$e->getLine().'【'.$e->getMessage().'】']);

+ 64 - 28
app/controller/api/store/service/Huafei.php

@@ -46,31 +46,39 @@ class Huafei extends BaseController
46 46
 			$ret = Db::name("order_huafei")->where("order_sn", $order_no)->update($updateData);
47 47
 			if($ret){
48 48
 				if($param['status'] == 2) {
49
-					//判断数据库有无此订单
50
-					$type_shop = 9;
51
-					$orderThird = app()->make(UserThirdRepository::class);
52
-					//预估养老金
53
-					$orderThird->yuguOrder(
54
-						$huafeiInfo['order_huafei_id'],
55
-						$huafeiInfo['commission'],
56
-						$huafeiInfo['uid'],
57
-						$huafeiInfo['order_sn'],
58
-						$type_shop,
59
-						'order_huafei');
60
-					//预估积分
61
-					$orderThird->yuguJifen(
62
-						$huafeiInfo['commission'] ,
63
-						$huafeiInfo['uid'],
64
-						$huafeiInfo['order_sn'],
65
-						$type_shop
66
-					);	
67
-					//复购金
68
-					$orderThird->yuguFugou(
69
-						$huafeiInfo['commission'] ,
70
-						$huafeiInfo['uid'],
71
-						$huafeiInfo['order_sn'],
72
-						$type_shop
73
-					);	
49
+					// //判断数据库有无此订单
50
+					// $type_shop = 9;
51
+					// $orderThird = app()->make(UserThirdRepository::class);
52
+					// //预估养老金
53
+					// $orderThird->yuguOrder(
54
+					// 	$huafeiInfo['order_huafei_id'],
55
+					// 	$huafeiInfo['commission'],
56
+					// 	$huafeiInfo['uid'],
57
+					// 	$huafeiInfo['order_sn'],
58
+					// 	$type_shop,
59
+					// 	'order_huafei');
60
+					// //预估积分
61
+					// $orderThird->yuguJifen(
62
+					// 	$huafeiInfo['commission'] ,
63
+					// 	$huafeiInfo['uid'],
64
+					// 	$huafeiInfo['order_sn'],
65
+					// 	$type_shop
66
+					// );	
67
+					// //复购金
68
+					// $orderThird->yuguFugou(
69
+					// 	$huafeiInfo['commission'] ,
70
+					// 	$huafeiInfo['uid'],
71
+					// 	$huafeiInfo['order_sn'],
72
+					// 	$type_shop
73
+					// );	
74
+				}
75
+
76
+				if($param['status'] == 3) {
77
+					//把赠送出去的养老金 积分 贡献值 复购金 改为已失效
78
+					Db::name('user_bill')->where('order_sn', $huafeiInfo['order_no'])->update(['status'=> -1]);
79
+					Db::name('user_sign_score')->where('order_id', $huafeiInfo['order_no'])->update(['status'=> 0]);
80
+					Db::name('user_sign_gongxian')->where('order_id', $huafeiInfo['order_no'])->update(['status'=> 0]);
81
+					Db::name('user_sign_fugou')->where('order_id', $huafeiInfo['order_no'])->update(['status'=> 0]);
74 82
 				}
75 83
 	
76 84
 				echo 'success';
@@ -121,7 +129,7 @@ class Huafei extends BaseController
121 129
 		try{
122 130
 			$order_no = $this->request->param('order_no');
123 131
 			$order_data = Db::name('order_huafei_hf') -> where('order_no', $order_no)->find();
124
-			$RES = $this->pushHf($order_data['uid'], $order_data['order_no'], $order_data['mobile'], $order_data['pay_price']);
132
+			$RES = $this->pushHf($order_data['uid'], $order_data['order_no'], $order_data['mobile'], $order_data['pay_price'], $order_data['order_id']);
125 133
 			return app('json')->success('充值话费推送补发成功', $RES);
126 134
 		}catch (\Exception $e) {
127 135
 			Db::name('log')->insert(['data'=>'充值话费推送补发错误:'.$e->getFile().':'.$e->getLine().'【'.$e->getMessage().'】']);
@@ -163,7 +171,35 @@ class Huafei extends BaseController
163 171
 
164 172
 
165 173
 	//话费充值推送
166
-	public function pushHf($uid, $order_sn, $phone, $money){
174
+	public function pushHf($uid, $order_sn, $phone, $money, $order_id = 0){
175
+
176
+		$commissionMoney = $money*0.04;
177
+		//判断数据库有无此订单
178
+		$type_shop = 9;
179
+		$orderThird = app()->make(UserThirdRepository::class);
180
+		//预估养老金
181
+		$orderThird->yuguOrder(
182
+			$order_id,
183
+			$commissionMoney,
184
+			$uid,
185
+			$order_sn,
186
+			$type_shop,
187
+			'order_huafei');
188
+		//预估积分&贡献值
189
+		$orderThird->yuguJifen(
190
+			$commissionMoney,
191
+			$uid,
192
+			$order_sn,
193
+			$type_shop
194
+		);						
195
+		//复购金
196
+		$orderThird->yuguFugou(
197
+			$commissionMoney,
198
+			$uid,
199
+			$order_sn,
200
+			$type_shop
201
+		);	
202
+
167 203
 		//推送订单
168 204
 		$push = $this->pushOrder($order_sn, $phone, $money);
169 205
 		Db::name('log')->insert(['data'=>'话费充值推送订单返回数据'.json_encode($push)]);
@@ -223,7 +259,7 @@ class Huafei extends BaseController
223 259
         $list = $query->page($page, $limit)->where($where)->select()->each(function ($item){
224 260
             return $item;
225 261
         });
226
-		return app('json')->success('获取话费充值记录成功', ['list'=>$list, 'count'=>$count]);
262
+		return app('json')->success('获取话费充值记录成功', ['list'=>$list, 'count'=>$count, 'uid'=>$uid]);
227 263
 	}
228 264
 
229 265