|
|
@@ -1516,4 +1516,57 @@ class StoreRefundOrderRepository extends BaseRepository
|
|
1516
|
1516
|
});
|
|
1517
|
1517
|
return true;
|
|
1518
|
1518
|
}
|
|
|
1519
|
+
|
|
|
1520
|
+ /**
|
|
|
1521
|
+ * 取消订单福利
|
|
|
1522
|
+ * @param $id
|
|
|
1523
|
+ * @throws \think\db\exception\DbException
|
|
|
1524
|
+ */
|
|
|
1525
|
+ public function cancelOrderBonus($id)
|
|
|
1526
|
+ {
|
|
|
1527
|
+
|
|
|
1528
|
+ // //分配逻辑
|
|
|
1529
|
+ // $store_order_data = Db::name('store_order')->where('group_order_id',$group_order_id)->find();
|
|
|
1530
|
+ //
|
|
|
1531
|
+ // //找到对应的商品id(product_id)
|
|
|
1532
|
+ // $store_order_product_data = Db::name('store_order_product')->where('order_id',$store_order_data['order_id'])->find();
|
|
|
1533
|
+ // //找到对应的商品让利金额或比例
|
|
|
1534
|
+ // $store_product_data = Db::name('store_product')->where('product_id',$store_order_product_data['product_id'])->find();
|
|
|
1535
|
+ // //下单用户
|
|
|
1536
|
+ // $user_data = Db::name('user')->where('uid',$store_order_data['uid'])->find();
|
|
|
1537
|
+ // $concession_pri = $store_order_data['con_pri'];
|
|
|
1538
|
+
|
|
|
1539
|
+
|
|
|
1540
|
+ $refundOrder = $this -> dao -> getWhere(['refund_order_id' => $id]);
|
|
|
1541
|
+ if(!$refundOrder){
|
|
|
1542
|
+ return ['code'=>-6,'message'=>'找不到退款订单'];
|
|
|
1543
|
+ }
|
|
|
1544
|
+ $refundOrder = $refundOrder -> toArray();
|
|
|
1545
|
+ $orderId = $refundOrder['order_id'];
|
|
|
1546
|
+
|
|
|
1547
|
+ Db::name("user_bill")
|
|
|
1548
|
+ ->where('link_id', $orderId)
|
|
|
1549
|
+ ->where('status', 0)
|
|
|
1550
|
+ ->update(['status' => -1]);
|
|
|
1551
|
+
|
|
|
1552
|
+ Db::name("user_sign_fugou")
|
|
|
1553
|
+ ->where('order_id', $orderId)
|
|
|
1554
|
+ ->where('status', -1)
|
|
|
1555
|
+ ->update(['status' => 0]);
|
|
|
1556
|
+
|
|
|
1557
|
+ Db::name("user_sign_score")
|
|
|
1558
|
+ ->where('order_id', $orderId)
|
|
|
1559
|
+ ->where('status', -1)
|
|
|
1560
|
+ ->update(['status' => 0]);
|
|
|
1561
|
+
|
|
|
1562
|
+ Db::name("user_sign_gongxian")
|
|
|
1563
|
+ ->where('order_id', $orderId)
|
|
|
1564
|
+ ->where('status', -1)
|
|
|
1565
|
+ ->update(['status' => 0]);
|
|
|
1566
|
+
|
|
|
1567
|
+ Db::name("user_pv_log")
|
|
|
1568
|
+ ->where('order_id', $orderId)
|
|
|
1569
|
+ ->where('status', -1)
|
|
|
1570
|
+ ->update(['status' => 0]);
|
|
|
1571
|
+ }
|
|
1519
|
1572
|
}
|