新增发送短信验证检验用户采购款够支付否

This commit is contained in:
liu 2024-06-15 16:06:28 +08:00
parent 341cbe7457
commit 8c1608207e
2 changed files with 14 additions and 1 deletions

View File

@ -5,6 +5,7 @@ namespace app\store\controller\store_order;
use app\api\logic\order\OrderLogic;
use app\api\validate\OrderValidate;
use app\common\model\order\Cart;
use app\common\model\user\User;
use app\store\lists\store_order\StoreOrderLists;
use app\common\controller\Definitions;
use app\common\enum\PayEnum;
@ -130,6 +131,16 @@ class StoreOrderController extends BaseAdminController
public function checkSms()
{
$params = (new StoreOrderValidate())->post()->goCheck('check');
$params['store_id'] = $this->request->adminInfo['store_id']; //当前登录的店铺id用于判断是否是当前店铺的订单
$user= User::where('id',$params['uid'])->find();
if(empty($user)){
return $this->fail('无该用户请检查');
}
$order = StoreOrderLogic::cartIdByOrderInfo($params['cartId'], null, $user, $params);
if($order['order']['pay_price'] > $user['purchase_funds']){
return $this->fail('当前用户采购款不足支付');
}
$res = (new StoreOrderLogic())->dealSendSms($params);
if($res){
return $this->success('发送成功',[],1,1);

View File

@ -21,6 +21,8 @@ class StoreOrderValidate extends BaseValidate
protected $rule = [
'id' => 'requireWithout:verify_code',
'verify_code' => 'requireWithout:id',
'uid' => 'require|number',
'cart_id' => 'require|array',
];
@ -83,7 +85,7 @@ class StoreOrderValidate extends BaseValidate
public function sceneCheck()
{
return $this->only(['uid']);
return $this->only(['uid','cart_id']);
}
}