|
|
@@ -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
|
|