hefei 1 year ago
parent
commit
a6d76f3043
1 changed files with 17 additions and 18 deletions
  1. 17 18
      app/controller/api/store/service/Huafei.php

+ 17 - 18
app/controller/api/store/service/Huafei.php

@@ -194,26 +194,10 @@ class Huafei extends BaseController
194 194
 	//话费充值推送
195 195
 	public function pushHf($uid, $order_sn, $phone, $money, $order_id = 0){
196 196
 
197
-		$commissionMoney = $money*0.02;
198 197
 		//判断数据库有无此订单
199 198
 		$type_shop = 9;
200 199
 		$orderThird = app()->make(UserThirdRepository::class);
201 200
 		//预估养老金
202
-		$orderThird->yuguOrder(
203
-			$order_id,
204
-			$commissionMoney,
205
-			$uid,
206
-			$order_sn,
207
-			$type_shop,
208
-			'order_huafei');
209
-		//预估积分&贡献值
210
-		$orderThird->yuguJifen(
211
-            $order_id,
212
-			$commissionMoney,
213
-			$uid,
214
-			$order_sn,
215
-			$type_shop
216
-		);						
217 201
 		// //复购金
218 202
 		// $orderThird->yuguFugou(
219 203
 		// 	$commissionMoney,
@@ -244,8 +228,23 @@ class Huafei extends BaseController
244 228
 				'finish_time' => date('Y-m-d H:i:s'),
245 229
 				'modify_time' => date('Y-m-d H:i:s'),
246 230
 			];
247
-			Db::name('order_huafei')->insert($insertdata);
248
-			return $push;
231
+            $order_id = Db::name('order_huafei')->insertGetId($insertdata);
232
+            $orderThird->yuguOrder(
233
+                $order_id,
234
+                $commissionMoney,
235
+                $uid,
236
+                $order_sn,
237
+                $type_shop,
238
+                'order_huafei');
239
+            //预估积分&贡献值
240
+            $orderThird->yuguJifen(
241
+                $order_id,
242
+                $commissionMoney,
243
+                $uid,
244
+                $order_sn,
245
+                $type_shop
246
+            );
247
+            return $push;
249 248
 		}else{
250 249
 			$commissionMoney = $money*0.02;
251 250
 			//失败入库记录