| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- <?php
- namespace ghs\controllers;
- use biz\sj\classes\CashClass;
- use common\components\dict;
- use common\components\util;
- use Yii;
- class CashController extends BaseController
- {
- //提现信息 ssh 20230424
- public function actionGetInfo()
- {
- $get = Yii::$app->request->get();
- $id = $get['id'] ?? 0;
- $cash = CashClass::getById($id, true);
- util::success(['info' => $cash]);
- }
- //客户列表 ssh 2019.11.30
- public function actionList()
- {
- $where = ['mainId' => $this->mainId];
- $list = CashClass::getCashList($where);
- util::success($list);
- }
- //申请提现 ssh 2021.3.14
- public function actionApply()
- {
- if (getenv('YII_ENV') == 'production') {
- util::fail('系统自动提现,无需人为操作');
- }else{
- //这里需要测试,所以打开来
- //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('申请失败');
- }
- }
- }
|