| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- <?php
- namespace hd\controllers;
- use biz\sj\classes\CashClass;
- use common\components\dict;
- use common\components\util;
- use Yii;
- class CashController extends BaseController
- {
- //客户列表 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()
- {
- 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', 'hd');
- $connection = Yii::$app->db;
- $transaction = $connection->beginTransaction();
- try {
- CashClass::addApply($get);
- $transaction->commit();
- util::success('提交成功,等待审核');
- } catch (\Exception $exception) {
- $transaction->rollBack();
- Yii::info("提现申请报错:" . $exception->getMessage());
- util::fail('申请失败');
- }
- }
- }
|