|
@@ -3394,6 +3394,34 @@ class WholeController extends Curd
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * @Desc 检测会员是否发生过支付行为
|
|
|
+ * @Author Gorden
|
|
|
+ * @Date 2024/10/22 10:13
|
|
|
+ *
|
|
|
+ * @param Request $request
|
|
|
+ * @return Response
|
|
|
+ */
|
|
|
+ public function checkPayMarking(Request $request)
|
|
|
+ {
|
|
|
+ $groupId = $request->get('group_id');
|
|
|
+ if (!$groupId) {
|
|
|
+ return json_fail('参数异常');
|
|
|
+ }
|
|
|
+
|
|
|
+ $payDetails = PayDetail::where('join_pay_order_id', $groupId)->get()->toArray();
|
|
|
+ foreach ($payDetails as $payDetail) {
|
|
|
+ if (!empty($payDetail['join_pay_object_json'])) {
|
|
|
+ $payObjectJson = json_decode($payDetail['join_pay_object_json'], true);
|
|
|
+ if (isset($payObjectJson['pay_marking']) && $payObjectJson['pay_marking'] == 'Y') {
|
|
|
+ return json_fail("会员发生过支付行为,确定后再执行操作");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return json_success('success');
|
|
|
+ }
|
|
|
+
|
|
|
public function addDishes(Request $request)
|
|
|
{
|
|
|
$params = $request->post();
|
|
@@ -3405,7 +3433,7 @@ class WholeController extends Curd
|
|
|
Db::beginTransaction();
|
|
|
try {
|
|
|
$order = Order::where('order_id', $params['order_id'])->first();
|
|
|
- if ($order->order_status_payment == 'SUCCESS'){
|
|
|
+ if ($order->order_status_payment == 'SUCCESS') {
|
|
|
throw new BusinessException("订单已支付,无法加菜");
|
|
|
}
|
|
|
$payDetail = PayDetail::where('join_pay_order_id', $order->order_groupby)->first();
|