|
|
|
@ -13,6 +13,7 @@ use App\Admin\Common\StoreQRCode; |
|
|
|
use App\Models\v3\Store as StoreModel; |
|
|
|
use App\Models\v3\User as UserModel; |
|
|
|
use App\Models\v3\Category as CategoryModel; |
|
|
|
use App\Models\LanzuUserBalance as UserBalanceModel; |
|
|
|
|
|
|
|
class StoreController extends AdminController |
|
|
|
{ |
|
|
|
@ -167,12 +168,21 @@ class StoreController extends AdminController |
|
|
|
$form->saved(function (Form $form){ |
|
|
|
$id = $form->getKey(); |
|
|
|
$store = StoreModel::find($id); |
|
|
|
// 添加商户钱包
|
|
|
|
if($form->isCreating()){ |
|
|
|
|
|
|
|
// 添加商户钱包
|
|
|
|
$userBalance = UserBalanceModel::where([ |
|
|
|
['user_type','=',5], |
|
|
|
['source_id','=',$id] |
|
|
|
])->first(); |
|
|
|
|
|
|
|
if(empty($userBalance)){ |
|
|
|
$userBalance = new UserBalanceModel(); |
|
|
|
$userBalance->user_type = 5; |
|
|
|
$userBalance->source_id = $id; |
|
|
|
$userBalance->save(); |
|
|
|
} |
|
|
|
// $form->isCreating() &&
|
|
|
|
if(!empty($id)){ |
|
|
|
|
|
|
|
if($form->isCreating() && !empty($id)){ |
|
|
|
$qrCode = new StoreQRCode(); |
|
|
|
// 生成小程序码 店铺
|
|
|
|
$sRes = $qrCode->SetStoreWeChatCode($id); |
|
|
|
@ -187,7 +197,6 @@ class StoreController extends AdminController |
|
|
|
// 剪裁图片
|
|
|
|
// $form->image('cash_code_img')->crop(270, 270, [5, 5]);
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
$form->disableResetButton(); |
|
|
|
|