|
@@ -5,6 +5,7 @@ namespace app\admin\logic;
|
|
|
use app\model\AccountModel;
|
|
|
use app\model\CommonModel;
|
|
|
use think\Exception;
|
|
|
+use think\facade\Config;
|
|
|
use think\facade\Db;
|
|
|
use think\response\Json;
|
|
|
|
|
@@ -26,7 +27,7 @@ class AccountLogic extends BaseLogic
|
|
|
$count = $db->count('a.id');
|
|
|
|
|
|
$list = $db
|
|
|
- ->field('a.id,a.username,a.status,a.name,b.title company_title,c.title card_title,a.mobile,a.remark,a.activetime,a.expiretime')
|
|
|
+ ->field('a.id,a.username,a.status,a.name,b.title company_title,c.title card_title,a.mobile,a.remark,a.starttime,a.expiretime')
|
|
|
->order('a.id', 'desc')
|
|
|
->page($data['page'], $data['size'])
|
|
|
->select()
|
|
@@ -49,7 +50,7 @@ class AccountLogic extends BaseLogic
|
|
|
$date = date('Y-m-d H:i:s');
|
|
|
|
|
|
$res = AccountModel::create([
|
|
|
- 'username' => $data['username'],
|
|
|
+ 'username' => Config::get('common.account_username_prefix') . $data['username'],
|
|
|
'pwd' => $pwd,
|
|
|
'salt' => $salt,
|
|
|
'password' => getPassword($pwd, $salt),
|
|
@@ -59,7 +60,7 @@ class AccountLogic extends BaseLogic
|
|
|
'status' => AccountModel::$status_not_active,
|
|
|
'is_del' => CommonModel::$del_normal,
|
|
|
'starttime' => $data['starttime'],
|
|
|
- 'expiretime' => $data['expiretime'],
|
|
|
+ 'expiretime' => date('Y-m-d', strtotime($data['expiretime']) + 3600 * 24),
|
|
|
'createrid' => self::$uid,
|
|
|
'creater' => self::$uname,
|
|
|
'addtime' => $date,
|
|
@@ -123,7 +124,7 @@ class AccountLogic extends BaseLogic
|
|
|
$pwd = randomkeys(6);
|
|
|
$salt = randomkeys(4);
|
|
|
Db::name('account')->insert([
|
|
|
- 'username' => $data['username_prefix'] . $data['username_year'] . str_pad($i, 4, '0', STR_PAD_LEFT),
|
|
|
+ 'username' => Config::get('common.account_username_prefix') . $data['username_prefix'] . $data['username_year'] . str_pad($i, 4, '0', STR_PAD_LEFT),
|
|
|
'pwd' => $pwd,
|
|
|
'salt' => $salt,
|
|
|
'password' => getPassword($pwd, $salt),
|
|
@@ -132,7 +133,7 @@ class AccountLogic extends BaseLogic
|
|
|
'status' => AccountModel::$status_not_active,
|
|
|
'is_del' => CommonModel::$del_normal,
|
|
|
'starttime' => $data['starttime'],
|
|
|
- 'expiretime' => $data['expiretime'],
|
|
|
+ 'expiretime' => date('Y-m-d', strtotime($data['expiretime']) + 3600 * 24),
|
|
|
'createrid' => self::$uid,
|
|
|
'creater' => self::$uname,
|
|
|
'addtime' => $date,
|