|
@@ -345,23 +345,17 @@ class Order extends BaseController
|
|
345
|
try {
|
345
|
try {
|
|
346
|
Db::startTrans();
|
346
|
Db::startTrans();
|
|
347
|
// 删除订单相关表 对应备份还没有创建
|
347
|
// 删除订单相关表 对应备份还没有创建
|
|
348
|
- $this->backupAndDelete('store_order', ['group_order_id' => $group_order_id]); //可以
|
|
|
|
349
|
- $this->backupAndDelete('store_group_order', ['group_order_id' => $group_order_id]);//可以
|
|
|
|
350
|
-// 取出并删除 pv
|
|
|
|
351
|
- $pv = $this->getValue('user_pv_log', ['order_id' => $order_id, 'status' => 1,], 'pv'); //可以
|
|
|
|
352
|
- Db::name('user')->where('uid', $uid)->dec('pv', $pv)->update();
|
|
|
|
353
|
- $user = Db::name('user')->where('uid', $uid)->find();
|
|
|
|
354
|
- if ($user) {
|
|
|
|
355
|
- Db::name('backup_user')->insert($user);
|
|
|
|
356
|
- }
|
|
|
|
357
|
- $this->backupAndDelete('user_pv_log', ['order_id' => $order_id]); //status状态判断还没 //可以
|
|
|
|
358
|
-// 取出 vr 消耗
|
|
|
|
359
|
- $payVr = $this->getValue('user_sign_vr', ['order_id' => $order_id, 'type' => 2,], 'number');
|
|
|
|
360
|
- $this->backupAndDelete('user_sign_vr', ['order_id' => $order_id]);
|
|
|
|
361
|
- Db::name('user')->where('uid', $uid)->inc('vr', $payVr)->update();
|
|
|
|
|
|
348
|
+ $this->backupAndDelete('store_order', ['group_order_id' => $group_order_id]);
|
|
|
|
349
|
+ $this->backupAndDelete('store_group_order', ['group_order_id' => $group_order_id]);
|
|
|
|
350
|
+ //取出并删除 pv
|
|
|
|
351
|
+ $pv = $this->getValue('user_pv_log', ['order_id' => $order_id, 'status' => 1,], 'pv');
|
|
|
|
352
|
+ $this->backupAndDelete('user_pv_log', ['order_id' => $order_id]); //status状态判断还没
|
|
|
|
353
|
+ //取出 vr 消耗
|
|
|
|
354
|
+ $payVr = $this->getValue('user_sign_vr', ['order_id' => $order_id, 'type' => 2,], 'number');
|
|
|
|
355
|
+ $this->backupAndDelete('user_sign_vr', ['order_id' => $order_id]);
|
|
362
|
// 取出购买赠送积分 / 支出积分
|
356
|
// 取出购买赠送积分 / 支出积分
|
|
363
|
- // $score = $this->getValue('user_sign_score', ['order_id' => $order_id, 'status' => 1,'source_type' => 3,'uid' => $uid,], 'reward_score');
|
|
|
|
364
|
- // $payScore = $this->getValue('user_sign_score', ['order_id' => $order_id, 'status' => 1,'pm' => 2,'uid' => $uid,], 'reward_score');
|
|
|
|
|
|
357
|
+ $score = $this->getValue('user_sign_score', ['order_id' => $order_id, 'status' => 1,'source_type' => 3,'uid' => $uid,], 'reward_score');
|
|
|
|
358
|
+ $payScore = $this->getValue('user_sign_score', ['order_id' => $order_id, 'status' => 1,'pm' => 2,'uid' => $uid,], 'reward_score');
|
|
365
|
//// // 取出推广赠送的积分和推广人的 uid
|
359
|
//// // 取出推广赠送的积分和推广人的 uid
|
|
366
|
// // $spreadScore = $this->getValue('user_sign_score', [
|
360
|
// // $spreadScore = $this->getValue('user_sign_score', [
|
|
367
|
// ['order_id', '=', $order_id],
|
361
|
// ['order_id', '=', $order_id],
|
|
@@ -378,7 +372,7 @@ class Order extends BaseController
|
|
378
|
// ['mark', 'like', '%推广%'],
|
372
|
// ['mark', 'like', '%推广%'],
|
|
379
|
// ], 'uid');
|
373
|
// ], 'uid');
|
|
380
|
// // // 删除所有相关积分记录
|
374
|
// // // 删除所有相关积分记录
|
|
381
|
-// $this->backupAndDelete('user_sign_score', ['order_id' => $order_id]);
|
|
|
|
|
|
375
|
+ $this->backupAndDelete('user_sign_score', ['order_id' => $order_id]);
|
|
382
|
//// // 贡献值
|
376
|
//// // 贡献值
|
|
383
|
// $gongXian = $this->getValue('user_sign_gongxian', ['order_id' => $order_id, 'status' => 1,'type' => 1,'uid' => $uid,], 'number');
|
377
|
// $gongXian = $this->getValue('user_sign_gongxian', ['order_id' => $order_id, 'status' => 1,'type' => 1,'uid' => $uid,], 'number');
|
|
384
|
// $spreadGongXian = 0;
|
378
|
// $spreadGongXian = 0;
|