|
@@ -371,7 +371,7 @@ class HomeController extends Controller
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * @api {get} /api/home/createorder 创建订单
|
|
|
|
|
|
|
+ * @api {post} /api/home/createorder 创建订单
|
|
|
* @apiDescription 创建订单
|
|
* @apiDescription 创建订单
|
|
|
* @apiGroup Order
|
|
* @apiGroup Order
|
|
|
* @apiPermission Passport
|
|
* @apiPermission Passport
|
|
@@ -426,7 +426,7 @@ class HomeController extends Controller
|
|
|
'username' => 'required',
|
|
'username' => 'required',
|
|
|
'phone' => 'required',
|
|
'phone' => 'required',
|
|
|
'email' => 'required',
|
|
'email' => 'required',
|
|
|
- 'sex' => 'sex',
|
|
|
|
|
|
|
+ 'sex' => 'required',
|
|
|
|
|
|
|
|
],
|
|
],
|
|
|
[
|
|
[
|
|
@@ -578,7 +578,7 @@ class HomeController extends Controller
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * @api {get} /api/home/order 获取订单详情
|
|
|
|
|
|
|
+ * @api {get} /api/home/orderdetail 获取订单详情
|
|
|
* @apiDescription 获取订单详情
|
|
* @apiDescription 获取订单详情
|
|
|
* @apiGroup Order
|
|
* @apiGroup Order
|
|
|
* @apiPermission None
|
|
* @apiPermission None
|
|
@@ -604,6 +604,13 @@ class HomeController extends Controller
|
|
|
* "service_time": "约120分钟", //服务时长
|
|
* "service_time": "约120分钟", //服务时长
|
|
|
* "price": 199, //应付金额
|
|
* "price": 199, //应付金额
|
|
|
* "deposit": 100 //定金
|
|
* "deposit": 100 //定金
|
|
|
|
|
+ * "paidinfo": {
|
|
|
|
|
+ * "id": 3,
|
|
|
|
|
+ * "order_id": "27",
|
|
|
|
|
+ * "order_price": 199, //订单价格
|
|
|
|
|
+ * "type": 0, //付款类型 0:全款 1:定金
|
|
|
|
|
+ * "paid_price": 199, //支付金额
|
|
|
|
|
+ * }
|
|
|
* }
|
|
* }
|
|
|
*
|
|
*
|
|
|
* }
|
|
* }
|
|
@@ -630,11 +637,12 @@ class HomeController extends Controller
|
|
|
return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '传入参数不正确!', $validator->messages());
|
|
return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '传入参数不正确!', $validator->messages());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- $order = OrderInfoModel::select(['id', 'out_trade_no', 'username', 'phone', 'email', 'schedule_time', 'status', 'store_id', 'price', 'deposit'])->find(request('order_id'));
|
|
|
|
|
|
|
+ $order = OrderInfoModel::with(['paidinfo'])->select(['id', 'out_trade_no', 'username', 'phone', 'email', 'schedule_time', 'status', 'store_id', 'price', 'deposit', 'product_id'])->find(request('order_id'));
|
|
|
$store = $order->store();
|
|
$store = $order->store();
|
|
|
- $product = ProductInfoModel::find(request($order->product_id))->first();
|
|
|
|
|
|
|
+ $product = ProductInfoModel::find($order->product_id);
|
|
|
|
|
|
|
|
$order['storename'] = $store;
|
|
$order['storename'] = $store;
|
|
|
|
|
+
|
|
|
$order['product_name'] = $product->name;
|
|
$order['product_name'] = $product->name;
|
|
|
$order['service_time'] = $product->service_time;
|
|
$order['service_time'] = $product->service_time;
|
|
|
|
|
|
|
@@ -741,7 +749,6 @@ class HomeController extends Controller
|
|
|
'notify_url' => url('/api/home/notify'),
|
|
'notify_url' => url('/api/home/notify'),
|
|
|
'openid' => $user->openid
|
|
'openid' => $user->openid
|
|
|
]);
|
|
]);
|
|
|
-
|
|
|
|
|
\Log::info($result);
|
|
\Log::info($result);
|
|
|
|
|
|
|
|
if ($result['return_code'] == 'SUCCESS' && $result['result_code'] == 'SUCCESS') {
|
|
if ($result['return_code'] == 'SUCCESS' && $result['result_code'] == 'SUCCESS') {
|
|
@@ -925,7 +932,7 @@ class HomeController extends Controller
|
|
|
return $this->api($data);
|
|
return $this->api($data);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- $mycoupons = UserCouponRelationModel::where('user_id',$user->id)->with('coupon')->orderBy('created_at', 'desc')->get();
|
|
|
|
|
|
|
+ $mycoupons = UserCouponRelationModel::where('user_id', $user->id)->with('coupon')->orderBy('created_at', 'desc')->get();
|
|
|
$mycoupons = $mycoupons->filter(function ($value) {
|
|
$mycoupons = $mycoupons->filter(function ($value) {
|
|
|
if (strtotime($value->coupon->end_time) < strtotime(Carbon::now('Asia/Shanghai'))) {
|
|
if (strtotime($value->coupon->end_time) < strtotime(Carbon::now('Asia/Shanghai'))) {
|
|
|
return false;
|
|
return false;
|