|
@@ -44,8 +44,13 @@ class OrderController extends AuthController
|
|
]);
|
|
]);
|
|
$user = $this->user;
|
|
$user = $this->user;
|
|
|
|
|
|
- if (sha1(md5($req['pay_password'])) !== $user['pay_password']) {
|
|
|
|
- return out(null, 10001, '密码错误');
|
|
|
|
|
|
+ if (!empty($req['pay_password'])) {
|
|
|
|
+ if (empty($user['pay_password'])) {
|
|
|
|
+ return out(null, 60010, '未设置支付密码');
|
|
|
|
+ }
|
|
|
|
+ if (sha1(md5($req['pay_password'])) !== $user['pay_password']) {
|
|
|
|
+ return out(null, 10001, '密码错误');
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
$discount_amount = 0;
|
|
$discount_amount = 0;
|
|
@@ -89,7 +94,7 @@ class OrderController extends AuthController
|
|
$order_sn = build_sn($order['id']);
|
|
$order_sn = build_sn($order['id']);
|
|
Order::where('id', $order['id'])->update(['order_sn' => $order_sn]);
|
|
Order::where('id', $order['id'])->update(['order_sn' => $order_sn]);
|
|
//保存订单患者信息
|
|
//保存订单患者信息
|
|
- $addPatient = Patient::select(['name', 'sex', 'avatar', 'birthday', 'relationship_type', 'info', 'card_type', 'card_number'])->where('id', $req['patient_id'])->first()->getOriginal();
|
|
|
|
|
|
+ $addPatient = Patient::select(['name', 'sex', 'avatar', 'birthday', 'relationship_type', 'info', 'card_type', 'card_number', 'card_img_url'])->where('id', $req['patient_id'])->first()->getOriginal();
|
|
$addPatient['order_id'] = $order['id'];
|
|
$addPatient['order_id'] = $order['id'];
|
|
$addPatient['patient_id'] = $req['patient_id'];
|
|
$addPatient['patient_id'] = $req['patient_id'];
|
|
if ($req['product_type'] == 1) {
|
|
if ($req['product_type'] == 1) {
|
|
@@ -172,8 +177,13 @@ class OrderController extends AuthController
|
|
]);
|
|
]);
|
|
$user = $this->user;
|
|
$user = $this->user;
|
|
|
|
|
|
- if (sha1(md5($req['pay_password'])) !== $user['pay_password']) {
|
|
|
|
- return out(null, 10001, '密码错误');
|
|
|
|
|
|
+ if (!empty($req['pay_password'])) {
|
|
|
|
+ if (empty($user['pay_password'])) {
|
|
|
|
+ return out(null, 60010, '未设置支付密码');
|
|
|
|
+ }
|
|
|
|
+ if (sha1(md5($req['pay_password'])) !== $user['pay_password']) {
|
|
|
|
+ return out(null, 10001, '密码错误');
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
$product_type = $req['product_type'];
|
|
$product_type = $req['product_type'];
|
|
@@ -230,7 +240,7 @@ class OrderController extends AuthController
|
|
$order_sn = build_sn($order['id']);
|
|
$order_sn = build_sn($order['id']);
|
|
Order::where('id', $order['id'])->update(['order_sn' => $order_sn]);
|
|
Order::where('id', $order['id'])->update(['order_sn' => $order_sn]);
|
|
//保存订单患者信息
|
|
//保存订单患者信息
|
|
- $addPatient = Patient::select(['name', 'sex', 'avatar', 'birthday', 'relationship_type', 'info', 'card_type', 'card_number'])->where('id', $req['patient_id'])->first()->getOriginal();
|
|
|
|
|
|
+ $addPatient = Patient::select(['name', 'sex', 'avatar', 'birthday', 'relationship_type', 'info', 'card_type', 'card_number', 'card_img_url'])->where('id', $req['patient_id'])->first()->getOriginal();
|
|
$addPatient['order_id'] = $order['id'];
|
|
$addPatient['order_id'] = $order['id'];
|
|
$addPatient['patient_id'] = $req['patient_id'];
|
|
$addPatient['patient_id'] = $req['patient_id'];
|
|
$addPatient['organization_id'] = $req['organization_id'];
|
|
$addPatient['organization_id'] = $req['organization_id'];
|
|
@@ -324,8 +334,13 @@ class OrderController extends AuthController
|
|
]);
|
|
]);
|
|
$user = $this->user;
|
|
$user = $this->user;
|
|
|
|
|
|
- if (sha1(md5($req['pay_password'])) !== $user['pay_password']) {
|
|
|
|
- return out(null, 10001, '密码错误');
|
|
|
|
|
|
+ if (!empty($req['pay_password'])) {
|
|
|
|
+ if (empty($user['pay_password'])) {
|
|
|
|
+ return out(null, 60010, '未设置支付密码');
|
|
|
|
+ }
|
|
|
|
+ if (sha1(md5($req['pay_password'])) !== $user['pay_password']) {
|
|
|
|
+ return out(null, 10001, '密码错误');
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
$discount_amount = 0;
|
|
$discount_amount = 0;
|
|
@@ -333,6 +348,7 @@ class OrderController extends AuthController
|
|
//计算优惠金额
|
|
//计算优惠金额
|
|
$discount_amount = UserCoupon::getDiscountAmount($req['user_coupon_id'], $user['id'], $req['total_amount'], 6);
|
|
$discount_amount = UserCoupon::getDiscountAmount($req['user_coupon_id'], $user['id'], $req['total_amount'], 6);
|
|
}
|
|
}
|
|
|
|
+
|
|
$payment_amount = $req['total_amount'] - $discount_amount;
|
|
$payment_amount = $req['total_amount'] - $discount_amount;
|
|
$payment_amount = $payment_amount < 0 ? 0 : $payment_amount;
|
|
$payment_amount = $payment_amount < 0 ? 0 : $payment_amount;
|
|
|
|
|
|
@@ -369,7 +385,7 @@ class OrderController extends AuthController
|
|
$order_sn = build_sn($order['id']);
|
|
$order_sn = build_sn($order['id']);
|
|
Order::where('id', $order['id'])->update(['order_sn' => $order_sn]);
|
|
Order::where('id', $order['id'])->update(['order_sn' => $order_sn]);
|
|
//保存订单患者信息
|
|
//保存订单患者信息
|
|
- $addPatient = Patient::select(['name', 'sex', 'avatar', 'birthday', 'relationship_type', 'info', 'card_type', 'card_number'])->where('id', $req['patient_id'])->first()->getOriginal();
|
|
|
|
|
|
+ $addPatient = Patient::select(['name', 'sex', 'avatar', 'birthday', 'relationship_type', 'info', 'card_type', 'card_number', 'card_img_url'])->where('id', $req['patient_id'])->first()->getOriginal();
|
|
$addPatient['order_id'] = $order['id'];
|
|
$addPatient['order_id'] = $order['id'];
|
|
$addPatient['patient_id'] = $req['patient_id'];
|
|
$addPatient['patient_id'] = $req['patient_id'];
|
|
OrderPatient::create($addPatient);
|
|
OrderPatient::create($addPatient);
|