Merge branch 'feat_agree' into dev
This commit is contained in:
commit
7f95bb1044
@ -275,6 +275,31 @@ class Auth extends BaseController
|
|||||||
return app('json')->success('退出登录');
|
return app('json')->success('退出登录');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function doMargin()
|
||||||
|
{
|
||||||
|
$user = $this->request->userInfo();
|
||||||
|
$merchant = Db::name('merchant')->where('uid', $user['uid'])->where('status', 1)->find();
|
||||||
|
if (!$merchant) {
|
||||||
|
return app('json')->fail('用户店铺异常');
|
||||||
|
}
|
||||||
|
$repository = app()->make(StoreOrderRepository::class);
|
||||||
|
$param = [
|
||||||
|
"status" => 0,
|
||||||
|
"is_del" => 0,
|
||||||
|
"mer_id" => $merchant['mer_id'],
|
||||||
|
"pay_type" => 1,
|
||||||
|
"attach" => "meal",
|
||||||
|
"order_info" => '{"is_margin":1,"margin":"' . $merchant['margin'] . '"}',
|
||||||
|
"pay_price" => $merchant['margin'],
|
||||||
|
"order_sn" => "bzj" . date('YmdHis') . uniqid(),
|
||||||
|
"body" => $merchant['mer_name'] . ' - ' . $merchant['margin'],
|
||||||
|
];
|
||||||
|
$payType = 'weixinApp';
|
||||||
|
$service = new PayService($payType, $param);
|
||||||
|
$payInfo = $service->pay(User::where(['uid'=>$user['uid']])->find());
|
||||||
|
return app('json')->success($payInfo);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return mixed
|
* @return mixed
|
||||||
* @throws DataNotFoundException
|
* @throws DataNotFoundException
|
||||||
|
@ -67,7 +67,9 @@ Route::group('api/', function () {
|
|||||||
|
|
||||||
//绑定推荐人
|
//绑定推荐人
|
||||||
Route::post('user/spread', 'api.Auth/spread');
|
Route::post('user/spread', 'api.Auth/spread');
|
||||||
|
//用户缴纳保证金
|
||||||
|
Route::post('user/margin', 'api.Auth/doMargin');
|
||||||
|
|
||||||
//优惠券
|
//优惠券
|
||||||
Route::group('coupon', function () {
|
Route::group('coupon', function () {
|
||||||
Route::post('receive/:id', 'api.store.product.StoreCoupon/receiveCoupon');
|
Route::post('receive/:id', 'api.store.product.StoreCoupon/receiveCoupon');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user