chore: 调整导入Excel,日期选择器的样式
This commit is contained in:
@@ -31,6 +31,7 @@ class Project extends Base {
|
||||
/*会员中心数据表*/
|
||||
$this->project_db = Db::name('project'); //
|
||||
$this->service_db = Db::name('service'); //
|
||||
$this->projectQueryPasswordDb = Db::name('project_query_password'); // 查询密码表
|
||||
|
||||
// 是否开启支付功能设置
|
||||
$this->userConfig = getUsersConfigData('all');
|
||||
@@ -106,7 +107,6 @@ class Project extends Base {
|
||||
// 添加表信息
|
||||
$data = array(
|
||||
'name' => $post['name'],
|
||||
'pwd' => $post['pwd'],
|
||||
'enterprise' => $post['enterprise'],
|
||||
'filing' => $post['filing'],
|
||||
'sid' =>$post['sid'],
|
||||
@@ -400,19 +400,18 @@ class Project extends Base {
|
||||
$rowData = $sheet->rangeToArray('A' . $row . ':' . $highestColumn . $row, NULL, TRUE, FALSE)[0];
|
||||
|
||||
// 确保行数据完整
|
||||
if (count($rowData) >= 6) {
|
||||
if (count($rowData) >= 5) {
|
||||
// 验证必要字段不为空
|
||||
if (empty(trim($rowData[0])) || empty(trim($rowData[1]))) {
|
||||
if (empty(trim($rowData[0]))) {
|
||||
continue; // 跳过必填字段为空的行
|
||||
}
|
||||
|
||||
$data[] = [
|
||||
'name' => trim($rowData[0]),
|
||||
'pwd' => trim($rowData[1]),
|
||||
'enterprise' => trim($rowData[2]),
|
||||
'filing' => trim($rowData[3]),
|
||||
'sid' => trim($rowData[4]),
|
||||
'limitationdate' => trim($rowData[5]),
|
||||
'enterprise' => trim($rowData[1]),
|
||||
'filing' => trim($rowData[2]),
|
||||
'sid' => trim($rowData[3]),
|
||||
'limitationdate' => trim($rowData[4]),
|
||||
'createtime' => getTime()
|
||||
];
|
||||
}
|
||||
@@ -487,4 +486,138 @@ class Project extends Base {
|
||||
imagedestroy($target);
|
||||
echo '<img src="../../uploads/imgs/'.$id.'.jpg">';
|
||||
}
|
||||
|
||||
// 查询密码列表
|
||||
public function password_index()
|
||||
{
|
||||
$list = array();
|
||||
|
||||
$param = input('param.');
|
||||
$condition = array();
|
||||
// 应用搜索条件
|
||||
foreach (['keywords'] as $key) {
|
||||
if (isset($param[$key]) && $param[$key] !== '') {
|
||||
if ($key == 'keywords') {
|
||||
$condition['password'] = array('LIKE', "%{$param[$key]}%");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据查询
|
||||
*/
|
||||
$count = $this->projectQueryPasswordDb->where($condition)->count();// 查询满足要求的总记录数
|
||||
$Page = new Page($count, config('paginate.list_rows'));// 实例化分页类 传入总记录数和每页显示的记录数
|
||||
$list = $this->projectQueryPasswordDb
|
||||
->where($condition)
|
||||
->order('id desc')
|
||||
->limit($Page->firstRow.','.$Page->listRows)
|
||||
->select();
|
||||
|
||||
$show = $Page->show();// 分页显示输出
|
||||
$this->assign('page',$show);// 赋值分页输出
|
||||
$this->assign('list',$list);// 赋值数据集
|
||||
$this->assign('pager',$Page);// 赋值分页集
|
||||
|
||||
return $this->fetch('password_index');
|
||||
}
|
||||
|
||||
// 新增/编辑查询密码
|
||||
public function password_add()
|
||||
{
|
||||
$id = input('id/d', 0);
|
||||
|
||||
if ($id > 0) {
|
||||
$info = $this->projectQueryPasswordDb->where(['id' => $id])->find();
|
||||
if (empty($info)) {
|
||||
$this->error('数据不存在');
|
||||
}
|
||||
$this->assign('info', $info);
|
||||
}
|
||||
|
||||
if (IS_POST) {
|
||||
$post = input('post.');
|
||||
|
||||
// 验证数据
|
||||
if (empty($post['password'])) {
|
||||
$this->error('查询密码不能为空');
|
||||
}
|
||||
|
||||
// 准备数据
|
||||
$data = [
|
||||
'password' => trim($post['password']),
|
||||
'allow_keywords' => trim($post['allow_keywords']),
|
||||
'deny_keywords' => trim($post['deny_keywords']),
|
||||
'status' => !empty($post['status']) ? 1 : 0,
|
||||
'updatetime' => time()
|
||||
];
|
||||
|
||||
if (empty($info)) {
|
||||
// 新增
|
||||
$data['createtime'] = time();
|
||||
$result = $this->projectQueryPasswordDb->insert($data);
|
||||
$msg = '新增';
|
||||
} else {
|
||||
// 编辑
|
||||
$result = $this->projectQueryPasswordDb->where(['id' => $id])->update($data);
|
||||
$msg = '编辑';
|
||||
}
|
||||
|
||||
if ($result !== false) {
|
||||
$this->success($msg . "成功", url('Project/password_index'));
|
||||
} else {
|
||||
$this->error($msg . "失败");
|
||||
}
|
||||
}
|
||||
|
||||
$this->assign('id', $id);
|
||||
return $this->fetch('password_add');
|
||||
}
|
||||
|
||||
// 删除查询密码
|
||||
public function password_del()
|
||||
{
|
||||
$id = input('del_id/d', 0);
|
||||
if (IS_AJAX_POST && !empty($id)) {
|
||||
$result = $this->projectQueryPasswordDb->where(['id' => $id])->delete();
|
||||
if ($result) {
|
||||
$this->success('删除成功');
|
||||
} else {
|
||||
$this->error('删除失败');
|
||||
}
|
||||
}
|
||||
$this->error('参数有误');
|
||||
}
|
||||
|
||||
// 批量删除查询密码
|
||||
public function password_batch_del()
|
||||
{
|
||||
$ids = input('del_id/a');
|
||||
if (IS_AJAX_POST && !empty($ids)) {
|
||||
$result = $this->projectQueryPasswordDb->where(['id' => ['IN', $ids]])->delete();
|
||||
if ($result) {
|
||||
$this->success('批量删除成功');
|
||||
} else {
|
||||
$this->error('批量删除失败');
|
||||
}
|
||||
}
|
||||
$this->error('参数有误');
|
||||
}
|
||||
|
||||
// 修改状态
|
||||
public function password_change_status()
|
||||
{
|
||||
$id = input('id/d', 0);
|
||||
$status = input('status/d', 0);
|
||||
|
||||
if (IS_AJAX_POST && !empty($id)) {
|
||||
$result = $this->projectQueryPasswordDb->where(['id' => $id])->update(['status' => $status, 'updatetime' => time()]);
|
||||
if ($result) {
|
||||
$this->success('状态修改成功');
|
||||
} else {
|
||||
$this->error('状态修改失败');
|
||||
}
|
||||
}
|
||||
$this->error('参数有误');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user