更新
This commit is contained in:
parent
0e8907130c
commit
30ca1b460f
@ -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]);
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user