作者 何书鹏

Merge branch 'master' of http://114.215.101.231:8099/guosheng/enterprise into heshupeng

... ... @@ -3,19 +3,19 @@ stages:
- pull
# job 华为测试服务添加自动部署
job1:
stage: pull
tags:
- huawei8
script:
- cd /home/wwwroot/t/enterprise
- git pull
# job 华为正式服务器添加自动部署 两个job同时存在为同时向两个服务器推送
#job2:
#job1:
# stage: pull
# tags:
# - huawei9
# - huawei8
# script:
# - cd /home/wwwroot/fast/enterprise
# - git pull
\ No newline at end of file
# - cd /home/wwwroot/t/enterprise
# - git pull
# job 华为正式服务器添加自动部署 两个job同时存在为同时向两个服务器推送
job2:
stage: pull
tags:
- huawei9
script:
- cd /home/wwwroot/fast/enterprise
- git pull
\ No newline at end of file
... ...
... ... @@ -39,7 +39,7 @@ class User extends Backend
if ($this->request->request('keyField')) {
return $this->selectpage();
}
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
list($where, $sort, $order, $offset, $limit) = $this->buildparams('user.id,user.username,user.nickname,user.password,user.card,user.work_address,user.studynum');
$total = $this->model
->with('group')
->where($where)
... ... @@ -82,6 +82,15 @@ class User extends Backend
if($this->check_identity($params['card'])) {
$this->error('该身份证号已存在');
}
$study = [];
if($params['study_id'] && $params['periodtime']) {
$study = [
'study_id' => $params['study_id'],
'periodtime' => strtotime($params['periodtime'])
];
unset($params['study_id']);
unset($params['periodtime']);
}
$result = false;
Db::startTrans();
try {
... ... @@ -92,6 +101,19 @@ class User extends Backend
$this->model->validateFailException(true)->validate($validate);
}
$result = $this->model->allowField(true)->save($params);
if($study) {
$study['third_id'] = $this->model->id;
$res['third_id'] = $study['third_id'];
$res['study_id'] = $study['study_id'];
$res['createtime'] = time();
$res['playtime'] = 0;
$classes_ids = Db::name('classes')->where('study_id',$res['study_id'])->where('is_major',1)->column('id');
foreach ($classes_ids as $v){
$res['class_id'] = $v;
Db::name('study_class')->insertGetId($res);
}
Db::name('third_study')->insertGetId($study);
}
Db::commit();
} catch (ValidateException $e) {
Db::rollback();
... ...
... ... @@ -29,5 +29,7 @@ return [
'Updatetime' => '更新时间',
'Token' => 'Token',
'Status' => '状态',
'Study_id' => '考试科目id',
'Periodtime' => '考试有效期',
'Leave password blank if dont want to change' => '不修改密码请留空',
];
... ...
... ... @@ -90,6 +90,18 @@
<input id="c-expirationtime" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[expirationtime]" type="text" value="{:date('Y-m-d H:i:s')}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Study_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-study_id" data-rule="" data-source="study/index" data-field="examname" class="form-control selectpage" name="row[study_id]" type="text" value="">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Periodtime')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-periodtime" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[periodtime]" type="text" value="{:date('Y-m-d H:i:s')}">
</div>
</div>
<div class="form-group layer-footer">
<label class="control-label col-xs-12 col-sm-2"></label>
<div class="col-xs-12 col-sm-8">
... ...
... ... @@ -21,6 +21,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
url: $.fn.bootstrapTable.defaults.extend.index_url,
pk: 'id',
sortName: 'user.id',
exportTypes: ['excel'],
exportOptions: {
// type: 'excel',
mso:{
... ... @@ -42,7 +43,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
{field: 'card', title: __('身份证'), operate:false},
{field: 'phone', title: __('手机号'), operate:false},
{field: 'sex', title: __('性别'), searchList: {"1":"男","0":'女'},formatter: Table.api.formatter.flag},
{field: 'work_address', title: __('工作地点'), operate:false},
{field: 'work_address', title: __('工作地点'),operate:'LIKE'},
{field: 'image', title: __('头像'), operate:false, events: Table.api.events.image, formatter: Table.api.formatter.image},
// {field: 'avatar', title: __('Avatar'), events: Table.api.events.image, formatter: Table.api.formatter.image, operate: false},
// {field: 'level', title: __('Level'), operate: 'BETWEEN', sortable: true},
... ...
... ... @@ -263,7 +263,8 @@ class Image
//创建新图像
$img = imagecreatetruecolor($width, $height);
// 调整默认颜色
$color = imagecolorallocate($img, 255, 255, 255);
// $color = imagecolorallocate($img, 255, 255, 255);
$color = imagecolorallocatealpha($img, 0, 0, 0, 127);
imagefill($img, 0, 0, $color);
//裁剪
imagecopyresampled($img, $this->im, 0, 0, $x, $y, $width, $height, $w, $h);
... ... @@ -459,7 +460,8 @@ class Image
imagefill($src, 0, 0, $color);
imagecopy($src, $this->im, 0, 0, $x, $y, $info[0], $info[1]);
imagecopy($src, $water, 0, 0, 0, 0, $info[0], $info[1]);
imagecopymerge($this->im, $src, $x, $y, 0, 0, $info[0], $info[1], $alpha);
// imagecopymerge($this->im, $src, $x, $y, 0, 0, $info[0], $info[1], $alpha);
imagecopy($this->im, $water, $x, $y, 0, 0, $info[0], $info[1]);
//销毁零时图片资源
imagedestroy($src);
} while (!empty($this->gif) && $this->gifNext());
... ...