This commit is contained in:
mkm 2023-08-19 11:50:56 +08:00
parent 0e8907130c
commit 30ca1b460f
2 changed files with 8 additions and 2 deletions

View File

@ -108,7 +108,7 @@ class CompanyController extends BaseAdminController
public function delete()
{
$params = (new CompanyValidate())->post()->goCheck('delete');
$admin_id=Company::where('id', $params['id'])->value('admin');
$admin_id=Company::where('id', $params['id'])->value('admin_id');
User::where('company_id',$params['id'])->update(['delete_time'=>time()]);
TaskScheduling::where('company_id',$params['id'])->update(['delete_time'=>time()]);
AdminLogic::delete(['id'=>$admin_id]);

View File

@ -14,7 +14,7 @@
namespace app\common\logic;
use app\adminapi\logic\auth\AdminLogic;
use app\common\model\Company;
use app\common\logic\BaseLogic;
use app\common\model\auth\Admin;
@ -89,6 +89,9 @@ class CompanyLogic extends BaseLogic
$admin['password'] = create_password(123456, $passwordSalt);
$admin_id=Admin::strict(false)->insertGetId($admin);
if($params['company_type']==16){
AdminLogic::insertRole($admin_id, [3]);
}
$userSn = User::createUserSn();
$admin['admin_id']=$admin_id;
$admin['sn']=$userSn;
@ -165,6 +168,9 @@ class CompanyLogic extends BaseLogic
Admin::strict(false)->where('account',$account)->update($admin);
$admin_id=Admin::where('account',$account)->value('id');
if($params['company_type']==16){
AdminLogic::insertRole($admin_id, [3]);
}
$user_id=User::where('account',$account)->value('id');
$arr['admin_id']=$admin_id;