更新项目部分结构,新增加DB

This commit is contained in:
2024-12-19 19:20:27 +08:00
parent 0fe2624e6b
commit 992c94250d
539 changed files with 1667 additions and 1906 deletions

View File

@@ -5,11 +5,8 @@ namespace admin\models;
use common\core\BaseModel;
use common\enums\UserRoleEnum;
use common\helpers\FuncHelper;
use common\models\AdminAccessToken;
use common\models\CashAccount;
use common\models\Log;
use common\models\Region;
use common\models\Store;
use common\models\oldDb\CashAccount;
use common\models\oldDb\Log;
use common\validators\MobileValidator;
use yii\db\Exception;
use yii\helpers\Json;
@@ -89,7 +86,7 @@ class RegisterForm extends BaseModel
if ($this->role == UserRoleEnum::STORE_ADMIN) {
if (empty($this->store_id)) throw new Exception('门店不能为空');
$store=Store::find()->where(['id'=>$this->store_id])->one();
$store= \common\models\oldDb\Store::find()->where(['id'=>$this->store_id])->one();
if (!$store){
throw new Exception('门店不存在!!');
}
@@ -121,7 +118,7 @@ class RegisterForm extends BaseModel
if ($this->role == UserRoleEnum::SUPER_ADMIN) {
//可提现账户表
$CashAccount = new CashAccount();
$CashAccount = new \common\models\oldDb\CashAccount();
$CashAccount->user_id = 0;
$CashAccount->user_type = 2;//平台
$CashAccount->total_cash = 0;//累计收益
@@ -133,7 +130,7 @@ class RegisterForm extends BaseModel
$CashAccount->last_apply_time = date('Y-m-d H:i:s', time());
$CashAccount->saveOrFail();
$log = new Log();
$log = new \common\models\oldDb\Log();
$log->admin_id = $model->attributes['uid'];
$log->operate_time = date('Y-m-d H:i:s', time());
$log->type = '用户注册';
@@ -169,7 +166,7 @@ class RegisterForm extends BaseModel
}
$token = AdminAccessToken::createToken($model->id, 'admin');
$token = \common\models\oldDb\AdminAccessToken::createToken($model->id, 'admin');
$t->commit();
return [
@@ -186,7 +183,7 @@ class RegisterForm extends BaseModel
{
$admin = \Yii::$app->user->identity;
$Store = Store::find()->where(['id' => $this->store_id])->one();
$Store = \common\models\oldDb\Store::find()->where(['id' => $this->store_id])->one();
if (!$Store) throw new Exception('诊所不存在');
if (!empty($this->bank_account_type)){