|
|
@@ -30,7 +30,28 @@ class CashController extends BaseController
|
|
|
//申请提现 ssh 2021.3.14
|
|
|
public function actionApply()
|
|
|
{
|
|
|
- util::fail('自动提现,无需人为操作');
|
|
|
+ //util::fail('系统自动提现,无需人为操作');
|
|
|
+ $get = Yii::$app->request->get();
|
|
|
+ $get['shopAdminId'] = $this->shopAdminId;
|
|
|
+ $shopAdmin = $this->shopAdmin;
|
|
|
+ if (isset($shopAdmin['super']) == false || $shopAdmin['super'] != 1) {
|
|
|
+ util::fail('超管才能申请提现');
|
|
|
+ }
|
|
|
+ $get['shopAdminName'] = $shopAdmin->name ?? '';
|
|
|
+ $get['shopId'] = $this->shopId;
|
|
|
+ $get['sjId'] = $this->sjId;
|
|
|
+ $get['ptStyle'] = dict::getDict('ptStyle', 'ghs');
|
|
|
+ $connection = Yii::$app->db;
|
|
|
+ $transaction = $connection->beginTransaction();
|
|
|
+ try {
|
|
|
+ CashClass::addApply($get);
|
|
|
+ $transaction->commit();
|
|
|
+ util::complete('申请成功,第二天到帐');
|
|
|
+ } catch (\Exception $exception) {
|
|
|
+ $transaction->rollBack();
|
|
|
+ Yii::info("提现申请报错:" . $exception->getMessage());
|
|
|
+ util::fail('申请失败');
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
}
|