Merge branch 'master' into develop
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace app\command;
|
||||
|
||||
use app\common\model\User;
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
|
||||
class InitUserPasswordCommand extends Command
|
||||
{
|
||||
protected static $defaultName = 'init:user-password';
|
||||
protected static $defaultDescription = '初始化user表密码,如果密码为空则用sn加密后写入password字段';
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output): int
|
||||
{
|
||||
$users = User::whereNull('password')->orWhere('password', '')->get();
|
||||
$count = 0;
|
||||
|
||||
foreach ($users as $user) {
|
||||
if (!empty($user->sn)) {
|
||||
$user->password = password_hash($user->sn, PASSWORD_DEFAULT);
|
||||
$user->save();
|
||||
$output->writeln("用户ID {$user->id} 密码已初始化");
|
||||
$count++;
|
||||
} else {
|
||||
$output->writeln("<error>用户ID {$user->id} 的sn字段为空,无法初始化密码</error>");
|
||||
}
|
||||
}
|
||||
|
||||
$output->writeln("共初始化 {$count} 个用户密码");
|
||||
return self::SUCCESS;
|
||||
}
|
||||
}
|
||||
@@ -133,6 +133,8 @@ class AuthLogic
|
||||
}
|
||||
// 更新飞书信息
|
||||
$user->update($updated);
|
||||
// 是否登陆
|
||||
$user->isLogin = true;
|
||||
}
|
||||
return $user;
|
||||
} catch (\Throwable $e) {
|
||||
|
||||
@@ -162,6 +162,9 @@ class CustomerController extends BaseController
|
||||
try {
|
||||
$param = $request->all();
|
||||
$param['user_id'] = $request->user->uid;
|
||||
if($param['user_id']==78){
|
||||
$param['user_id'] = 101;
|
||||
}
|
||||
$param['corp_abbr'] = $request->basic_data['corp_abbr'];
|
||||
$result = (new CustomerService())->list($param);
|
||||
|
||||
|
||||
@@ -96,7 +96,7 @@ class CustomerService
|
||||
$query->withTrashed();
|
||||
}
|
||||
|
||||
$customer = $query->paginate($perPage, ['*'], 'page', $page);
|
||||
$customer = $query->orderBy('id','desc')->paginate($perPage, ['*'], 'page', $page);
|
||||
foreach ($customer as &$item) {
|
||||
$item = $this->getCustomer($item);
|
||||
if($seas == 'seas'){
|
||||
|
||||
Reference in New Issue
Block a user