|
@@ -186,16 +186,16 @@ class MobileController extends UserApi
|
|
|
'county'=>'require|integer',
|
|
|
'address'=>'require',
|
|
|
]);
|
|
|
- $mobile=Mobile::where('status',0)->findOrFail($data['mobile_id']);
|
|
|
+
|
|
|
+ Db::startTrans();
|
|
|
+ $mobile=Mobile::lock(true)->findOrFail($data['mobile_id']);
|
|
|
if($mobile['type']==1){
|
|
|
$this->_validate([
|
|
|
'pay_type'=>'require|in:1,2,3',
|
|
|
]);
|
|
|
}
|
|
|
-
|
|
|
+ $mobile->shouldBuy();
|
|
|
Area::shouldSend($data['county']);
|
|
|
-
|
|
|
- Db::startTrans();
|
|
|
SmsSend::setMobile($data['phone'])->setCode($data['sms_code'] ?? '')->setEvent('order')->check();
|
|
|
$order = $data;
|
|
|
$order['admin_id'] = $mobile['proxy_id'];
|