This commit is contained in:
lewis 2025-03-06 17:49:09 +08:00
parent 6757d05842
commit 95d8016567
27 changed files with 335 additions and 70 deletions

View File

@ -6,6 +6,7 @@ namespace app\admin\controller;
use app\common\service\UploadService;
use Exception;
use think\response\Json;
use Tinywan\Storage\Storage;
class UploadController extends BaseAdminController
@ -41,4 +42,19 @@ class UploadController extends BaseAdminController
return $this->fail($e->getMessage());
}
}
/**
* @notes 上传文件
*/
public function file()
{
try {
$cid = $this->request->post('cid', 0);
$result = UploadService::file($cid);
return $this->success('上传成功', $result);
} catch (Exception $e) {
return $this->fail($e->getMessage());
}
}
}

View File

@ -19,6 +19,10 @@ use app\admin\lists\auth\AdminLists;
use app\admin\validate\auth\AdminValidate;
use app\admin\logic\auth\AdminLogic;
use app\admin\validate\auth\editSelfValidate;
use app\common\model\auth\Admin;
use app\common\model\dept\Dept;
use app\common\model\dept\Jobs;
use app\common\model\dept\Orgs;
/**
* 管理员控制器
@ -124,4 +128,94 @@ class AdminController extends BaseAdminController
return $this->success('操作成功', [], 1, 1);
}
//获取所有人员
public function getAdminsByAll()
{
$params = $this->request->get();
$where = [];
if(!empty($params['exclude_id'])){
$where[] = ['id','<>',$params['exclude_id']];
}
if(!empty($params['org_id'])){
$where[] = ['org_id','=',$params['org_id']];
}
$data = Admin::field('id,name,avatar,org_id,dept_id,job_id')->where($where)->select()->each(function($item){
if (empty($item['job_id'])) {
$item['job_name'] = '';
} else {
$job = Jobs::field('name')->where('id',$item['job_id'])->findOrEmpty();
$item['job_name'] = $job->isEmpty()? '' : $job['name'];
}
if (empty($item['dept_id'])) {
$item['dept_name'] = '';
} else {
$dept = Dept::field('name')->where('id',$item['dept_id'])->findOrEmpty();
$item['dept_name'] = $dept->isEmpty() ? '' : $dept['name'];
}
if (empty($item['org_id'])) {
$item['org_name'] = '';
} else {
$org = Orgs::field('name')->where('id',$item['org_id'])->findOrEmpty();
$item['org_name'] = $org->isEmpty() ? '' : $org['name'];
}
return $item;
})->toArray();
foreach($data as $k=>$v){
unset($data[$k]['role_id']);
}
return $this->success('请求成功',$data);
}
//获取某个部门下的所有人员
public function getAdminsByDept()
{
$params = $this->request->get();
if(empty($params['dept_id'])){
return $this->fail('参数错误');
}
$where = [];
if(!empty($params['exclude_id'])){
$where[] = ['id','<>',$params['exclude_id']];
}
$data = Admin::field('id,name,avatar,org_id,dept_id,job_id')->where('dept_id',$params['dept_id'])->where($where)->select()->each(function($item){
$job = Jobs::field('name')->where('id',$item['job_id'])->findOrEmpty();
$dept = Dept::field('name')->where('id',$item['dept_id'])->findOrEmpty();
$org = Orgs::field('name')->where('id',$item['org_id'])->findOrEmpty();
$item['job_name'] = $job->isEmpty() ? '' : $job['name'];
$item['dept_name'] = $dept->isEmpty() ? '' : $dept['name'];
$item['org_name'] = $org->isEmpty() ? '' : $org['name'];
return $item;
})->toArray();
foreach($data as $k=>$v){
unset($data[$k]['role_id']);
}
return $this->success('请求成功',$data);
}
//获取某个岗位下的所有人员
public function getAdminsByJob()
{
$params = $this->request->get();
if(empty($params['job_id'])){
return $this->fail('参数错误');
}
$where = [];
if(!empty($params['exclude_id'])){
$where[] = ['id','<>',$params['exclude_id']];
}
$data = Admin::field('id,name,avatar,org_id,dept_id,job_id')->where('job_id',$params['job_id'])->where($where)->select()->each(function($item){
$job = Jobs::field('name')->where('id',$item['job_id'])->findOrEmpty();
$dept = Dept::field('name')->where('id',$item['dept_id'])->findOrEmpty();
$org = Orgs::field('name')->where('id',$item['org_id'])->findOrEmpty();
$item['job_name'] = $job->isEmpty() ? '' : $job['name'];
$item['dept_name'] = $dept->isEmpty() ? '' : $dept['name'];
$item['org_name'] = $org->isEmpty() ? '' : $org['name'];
return $item;
})->toArray();
foreach($data as $k=>$v){
unset($data[$k]['role_id']);
}
return $this->success('请求成功',$data);
}
}

View File

@ -17,6 +17,9 @@ namespace app\admin\controller\dept;
use app\admin\controller\BaseAdminController;
use app\admin\logic\dept\DeptLogic;
use app\admin\validate\dept\DeptValidate;
use app\common\model\auth\Admin;
use app\common\model\dept\Dept;
use app\common\model\dept\Orgs;
/**
* 部门管理控制器
@ -35,7 +38,7 @@ class DeptController extends BaseAdminController
{
$params = $this->request->get();
$result = DeptLogic::lists($params);
return $this->success('',$result);
return $this->success('', $result);
}
@ -50,7 +53,7 @@ class DeptController extends BaseAdminController
public function leaderDept()
{
$result = DeptLogic::leaderDept();
return $this->success('',$result);
return $this->success('', $result);
}
@ -123,5 +126,31 @@ class DeptController extends BaseAdminController
return $this->data($result);
}
//某个组织下面的部门
public function listToOrg()
{
$params = $this->request->get();
$data = Dept::field('id,name,mobile,status')->where('org_id', $params['org_id'])->where('status', 0)->select()->toArray();
return $this->success('请求成功', $data);
}
//获取所有部门
public function getAllDept()
{
$data = Dept::field('id,name,org_id')->where('status', 1)->select()->each(function ($item) {
if (empty($item['org_id'])) {
$item['org_name'] = '';
} else {
$org = Orgs::field('name')->where('id', $item['org_id'])->findOrEmpty();
$item['org_name'] = $org->isEmpty() ? '' : $org['name'];
}
$item['admin_num'] = Admin::where('dept_id', $item['id'])->count();
unset($item['org_id']);
return $item;
})->toArray();
$result = group_by($data, 'org_name');
return $this->success('请求成功', $result);
}
}

View File

@ -18,6 +18,8 @@ use app\admin\controller\BaseAdminController;
use app\admin\lists\dept\JobsLists;
use app\admin\logic\dept\JobsLogic;
use app\admin\validate\dept\JobsValidate;
use app\common\model\auth\Admin;
use app\common\model\dept\Jobs;
/**
@ -108,5 +110,22 @@ class JobsController extends BaseAdminController
return $this->data($result);
}
//某个部门下面的岗位
public function listToDept()
{
$params = $this->request->get();
$data = Jobs::field('id,name,status,sort,create_time')->where('dept_id',$params['dept_id'])->where('status',0)->select()->toArray();
return $this->success('请求成功',$data);
}
//获取所有岗位
public function getAllJobs()
{
$data = Jobs::field('id,name')->where('status',0)->select()->each(function($item){
$item['admin_num'] = Admin::where('job_id',$item['id'])->count();
return $item;
})->toArray();
return $this->success('请求成功',$data);
}
}

View File

@ -166,11 +166,7 @@ class AdminLists extends BaseAdminDataLists implements ListsExtendInterface, Lis
}
}
$deptName = '';
foreach ($v['dept_id'] as $deptId) {
$deptName .= $deptLists[$deptId] ?? '';
$deptName .= '/';
}
$deptName = $deptLists[$v['dept_id']] ?? '';
$jobsName = '';
foreach ($v['jobs_id'] as $jobsId) {

View File

@ -16,6 +16,7 @@ namespace app\admin\logic\dept;
use app\common\enum\YesNoEnum;
use app\common\logic\BaseLogic;
use app\common\model\auth\Admin;
use app\common\model\dept\Dept;
use support\exception\BusinessException;
@ -114,6 +115,7 @@ class DeptLogic extends BaseLogic
'pid' => $params['pid'],
'name' => $params['name'],
'leader' => $params['leader'] ?? '',
'leader_id' => $params['leader_id'] ?? '',
'mobile' => $params['mobile'] ?? '',
'status' => $params['status'],
'sort' => $params['sort'] ?? 0
@ -142,6 +144,7 @@ class DeptLogic extends BaseLogic
'pid' => $pid,
'name' => $params['name'],
'leader' => $params['leader'] ?? '',
'leader_id' => $params['leader_id'] ?? '',
'mobile' => $params['mobile'] ?? '',
'status' => $params['status'],
'sort' => $params['sort'] ?? 0

View File

@ -35,21 +35,6 @@ class Admin extends BaseModel
return AdminRole::where('admin_id', $data['id'])->column('role_id');
}
/**
* @notes 关联部门id
* @param $value
* @param $data
* @return array
* @author 乔峰
* @date 2022/11/25 15:00
*/
public function getDeptIdAttr($value, $data)
{
return AdminDept::where('admin_id', $data['id'])->column('dept_id');
}
/**
* @notes 关联岗位id
* @param $value

View File

@ -0,0 +1,39 @@
<?php
// +----------------------------------------------------------------------
// | likeadmin快速开发前后端分离管理后台PHP版
// +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo
// | gitee下载https://gitee.com/likeshop_gitee/likeadmin
// | github下载https://github.com/likeshop-github/likeadmin
// | 访问官网https://www.likeadmin.cn
// | likeadmin团队 版权所有 拥有最终解释权
// +----------------------------------------------------------------------
// | author: likeadminTeam
// +----------------------------------------------------------------------
namespace app\common\model\dept;
use app\common\model\BaseModel;
use think\model\concern\SoftDelete;
/**
* Orgs模型
* Class Orgs
* @package app\common\model
*/
class Orgs extends BaseModel
{
use SoftDelete;
protected $name = 'orgs';
protected $deleteTime = 'delete_time';
public function getStatusTextAttr($value,$data): string
{
$status = [0=>'正常',1=>'停用'];
return $status[$data['status']];
}
}

View File

@ -29,6 +29,8 @@ class OaWork extends BaseModel
use SoftDelete;
protected $name = 'oa_work';
protected $deleteTime = 'delete_time';
protected $json = ['annex'];
protected $jsonAssoc = true;
public function getTypeTextAttr($value,$data): string
{

View File

@ -148,4 +148,66 @@ class UploadService
throw new Exception($e->getMessage());
}
}
public static function file($cid, int $sourceId = 0, int $source = FileEnum::SOURCE_ADMIN, string $saveDir = 'uploads/files')
{
try {
$config = [
'default' => ConfigService::get('storage', 'default', 'local'),
'engine' => ConfigService::get('storage') ?? ['local' => []],
];
// 2、执行文件上传
$StorageDriver = new StorageDriver($config);
$StorageDriver->setUploadFile('file');
$fileName = $StorageDriver->getFileName();
$fileInfo = $StorageDriver->getFileInfo();
// 校验上传文件后缀
if (!in_array(strtolower($fileInfo['ext']), config('project.file_file'))) {
throw new Exception("上传文件不允许上传" . $fileInfo['ext'] . "文件");
}
//校验文件大小
if($fileInfo['size'] > 1073741824){
throw new Exception("上传文件大小不能超过1GB");
}
// 上传文件
$saveDir = $saveDir . '/' . date('Ymd');
if (!$StorageDriver->upload($saveDir)) {
throw new Exception($StorageDriver->getError());
}
// 3、处理文件名称
if (strlen($fileInfo['name']) > 128) {
$name = substr($fileInfo['name'], 0, 123);
$nameEnd = substr($fileInfo['name'], strlen($fileInfo['name']) - 5, strlen($fileInfo['name']));
$fileInfo['name'] = $name . $nameEnd;
}
// 4、写入数据库中
$file = File::create([
'cid' => $cid,
'type' => FileEnum::FILE_TYPE,
'name' => $fileInfo['name'],
'uri' => $saveDir . '/' . str_replace("\\", "/", $fileName),
'source' => $source,
'source_id' => $sourceId,
'create_time' => time(),
]);
// 5、返回结果
return [
'id' => $file['id'],
'cid' => $file['cid'],
'type' => $file['type'],
'name' => $file['name'],
'uri' => FileService::getFileUrl($file['uri']),
'url' => $file['uri']
];
} catch (Exception $e) {
throw new Exception($e->getMessage());
}
}
}

View File

@ -45,10 +45,10 @@ abstract class Server
$finfo = finfo_open(FILEINFO_MIME_TYPE);
@$this->file->getMime = finfo_file($finfo, $this->file->getPathname());
// 校验上传文件后缀
$limit = array_merge(config('project.file_image'), config('project.file_video'));
if (!in_array(strtolower($this->file->extension), $limit)) {
throw new Exception('不允许上传' . $this->file->extension . '后缀文件');
}
// $limit = array_merge(config('project.file_image'), config('project.file_video'));
// if (!in_array(strtolower($this->file->extension), $limit)) {
// throw new Exception('不允许上传' . $this->file->extension . '后缀文件');
// }
// 文件信息
$this->fileInfo = [

View File

@ -511,3 +511,12 @@ if (!function_exists('getOrderTypeName')) {
return $typeMap[$type] ?? '';
}
}
function group_by($array, $key): array
{
$result = [];
foreach ($array as $item) {
$result[$item[$key]][] = $item;
}
return $result;
}

View File

@ -34,7 +34,6 @@ class OaExamineTempController extends BaseAdminController
/**
* @notes 获取考核模板列表
* @return \think\response\Json
* @author likeadmin
* @date 2024/06/03 13:35
*/
@ -46,13 +45,13 @@ class OaExamineTempController extends BaseAdminController
/**
* @notes 添加考核模板
* @return \think\response\Json
* @author likeadmin
* @date 2024/06/03 13:35
*/
public function add()
{
$params = (new OaExamineTempValidate())->post()->goCheck('add');
$params['create_user'] = $this->adminId;
$result = OaExamineTempLogic::add($params);
if (true === $result) {
return $this->success('添加成功', [], 1, 1);
@ -63,7 +62,6 @@ class OaExamineTempController extends BaseAdminController
/**
* @notes 编辑考核模板
* @return \think\response\Json
* @author likeadmin
* @date 2024/06/03 13:35
*/
@ -80,7 +78,6 @@ class OaExamineTempController extends BaseAdminController
/**
* @notes 删除考核模板
* @return \think\response\Json
* @author likeadmin
* @date 2024/06/03 13:35
*/
@ -97,7 +94,6 @@ class OaExamineTempController extends BaseAdminController
/**
* @notes 获取考核模板详情
* @return \think\response\Json
* @author likeadmin
* @date 2024/06/03 13:35
*/
@ -110,7 +106,6 @@ class OaExamineTempController extends BaseAdminController
/**
* @notes 删除考核项
* @return \think\response\Json
* @author likeadmin
* @date 2024/06/03 13:35
*/

View File

@ -38,7 +38,7 @@
->page($page_no, $page_size)->order('id desc')->select()->each(function($data){
$admin = Admin::field('id,name,dept_id')->where('id',$data['admin_id'])->findOrEmpty()->toArray();
if (!empty($admin['dept_id'])) {
$dept = Dept::where('id',$admin['dept_id'][0])->value('name');
$dept = Dept::where('id',$admin['dept_id'])->value('name');
$data['dept_name'] = $dept ?? '';
} else {
$data['dept_name'] = '';
@ -114,7 +114,7 @@
public function add()
{
$param = $this->request->post(['flow_id','check_admin_ids','copy_uids','extends']);
$param = $this->request->post();
if(empty($param['flow_id'])){
return $this->fail("请选择审批流程");
}
@ -283,7 +283,7 @@
}
public function check(){
$params = $this->request->post(['id','check','content','check_node','check_admin_ids']);
$params = $this->request->post();
if(empty($params['id'])){
return $this->fail('缺少数据主键');
}

View File

@ -251,7 +251,7 @@
->page($page_no, $page_size)->order('id desc')->select()->each(function($data){
$admin = Admin::field('id,name,dept_id')->where('id',$data['admin_id'])->findOrEmpty();
if (!empty($admin['dept_id'])) {
$dept = Dept::where('id',$admin['dept_id'][0])->value('name');
$dept = Dept::where('id',$admin['dept_id'])->value('name');
$data['dept_name'] = $dept;
} else {
$data['dept_name'] = '';
@ -471,7 +471,7 @@
}
public function check(){
$params = $this->request->post(['id','check','content','check_node','check_admin_ids']);
$params = $this->request->post();
if(empty($params['id'])){
return $this->fail('缺少数据主键');
}
@ -702,7 +702,7 @@
->page($page_no, $page_size)->order('id desc')->select()->each(function($data){
$admin = Admin::field('id,name,dept_id')->where('id',$data['admin_id'])->findOrEmpty();
if (!empty($admin['dept_id'])) {
$dept = Dept::where('id',$admin['dept_id'][0])->value('name');
$dept = Dept::where('id',$admin['dept_id'])->value('name');
$data['dept_name'] = $dept;
} else {
$data['dept_name'] = '';

View File

@ -33,7 +33,6 @@ class OaPersonalQuitController extends BaseAdminController
/**
* @notes 获取离职档案列表
* @return \think\response\Json
* @author likeadmin
* @date 2024/05/23 09:43
*/
@ -45,7 +44,6 @@ class OaPersonalQuitController extends BaseAdminController
/**
* @notes 添加离职档案
* @return \think\response\Json
* @author likeadmin
* @date 2024/05/23 09:43
*/
@ -62,7 +60,6 @@ class OaPersonalQuitController extends BaseAdminController
/**
* @notes 编辑离职档案
* @return \think\response\Json
* @author likeadmin
* @date 2024/05/23 09:43
*/
@ -79,7 +76,6 @@ class OaPersonalQuitController extends BaseAdminController
/**
* @notes 删除离职档案
* @return \think\response\Json
* @author likeadmin
* @date 2024/05/23 09:43
*/
@ -93,7 +89,6 @@ class OaPersonalQuitController extends BaseAdminController
/**
* @notes 获取离职档案详情
* @return \think\response\Json
* @author likeadmin
* @date 2024/05/23 09:43
*/

View File

@ -33,7 +33,6 @@ class OaWorkController extends BaseAdminController
/**
* @notes 获取工作汇报列表
* @return \think\response\Json
* @author likeadmin
* @date 2024/05/23 15:56
*/
@ -45,7 +44,6 @@ class OaWorkController extends BaseAdminController
/**
* @notes 添加工作汇报
* @return \think\response\Json
* @author likeadmin
* @date 2024/05/23 15:56
*/
@ -62,7 +60,6 @@ class OaWorkController extends BaseAdminController
/**
* @notes 编辑工作汇报
* @return \think\response\Json
* @author likeadmin
* @date 2024/05/23 15:56
*/
@ -79,7 +76,6 @@ class OaWorkController extends BaseAdminController
/**
* @notes 删除工作汇报
* @return \think\response\Json
* @author likeadmin
* @date 2024/05/23 15:56
*/
@ -96,7 +92,6 @@ class OaWorkController extends BaseAdminController
/**
* @notes 获取工作汇报详情
* @return \think\response\Json
* @author likeadmin
* @date 2024/05/23 15:56
*/

View File

@ -33,7 +33,6 @@ class OaWorkRecordController extends BaseAdminController
/**
* @notes 获取汇报工作发送记录表列表
* @return \think\response\Json
* @author likeadmin
* @date 2024/05/23 16:48
*/
@ -45,7 +44,6 @@ class OaWorkRecordController extends BaseAdminController
/**
* @notes 添加汇报工作发送记录表
* @return \think\response\Json
* @author likeadmin
* @date 2024/05/23 16:48
*/
@ -62,7 +60,6 @@ class OaWorkRecordController extends BaseAdminController
/**
* @notes 编辑汇报工作发送记录表
* @return \think\response\Json
* @author likeadmin
* @date 2024/05/23 16:48
*/
@ -79,7 +76,6 @@ class OaWorkRecordController extends BaseAdminController
/**
* @notes 删除汇报工作发送记录表
* @return \think\response\Json
* @author likeadmin
* @date 2024/05/23 16:48
*/
@ -93,7 +89,6 @@ class OaWorkRecordController extends BaseAdminController
/**
* @notes 获取汇报工作发送记录表详情
* @return \think\response\Json
* @author likeadmin
* @date 2024/05/23 16:48
*/

View File

@ -15,6 +15,7 @@
namespace app\oa\lists\works\hr;
use app\common\model\auth\Admin;
use app\oa\lists\BaseAdminDataLists;
use app\common\model\works\rlzy\OaDepartmentChange;
use app\common\lists\ListsSearchInterface;
@ -38,7 +39,7 @@ class OaDepartmentChangeLists extends BaseAdminDataLists implements ListsSearchI
public function setSearch(): array
{
return [
'=' => ['uid', 'from_did', 'to_did', 'status', 'move_time'],
'=' => ['uid', 'from_did', 'to_did', 'status'],
];
}
@ -54,8 +55,15 @@ class OaDepartmentChangeLists extends BaseAdminDataLists implements ListsSearchI
*/
public function lists(): array
{
return OaDepartmentChange::where($this->searchWhere)
->field(['id', 'uid', 'from_did', 'to_did', 'remark', 'admin_id', 'status', 'move_time'])
$query = OaDepartmentChange::where($this->searchWhere);
if (!empty($this->params['uid_name'])) {
$userIds = Admin::whereLike('name', $this->params['uid_name'])->column('id');
$query->whereIn('uid', $userIds);
}
if (!empty($this->params['move_time'])) {
$query->whereTime('move_time', $this->params['move_time']);
}
return $query->field(['id', 'uid', 'from_did', 'to_did', 'remark', 'admin_id', 'status', 'move_time'])
->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc'])
->select()->each(function($data){
@ -76,7 +84,15 @@ class OaDepartmentChangeLists extends BaseAdminDataLists implements ListsSearchI
*/
public function count(): int
{
return OaDepartmentChange::where($this->searchWhere)->count();
$query = OaDepartmentChange::where($this->searchWhere);
if (!empty($this->params['uid_name'])) {
$userIds = Admin::whereLike('name', $this->params['uid_name'])->column('id');
$query->whereIn('uid', $userIds);
}
if (!empty($this->params['move_time'])) {
$query->whereTime('move_time', $this->params['move_time']);
}
return $query->count();
}
}

View File

@ -39,7 +39,7 @@ class OaPersonalQuitLists extends BaseAdminDataLists implements ListsSearchInter
public function setSearch(): array
{
return [
'=' => ['uid', 'lead_admin_id', 'connect_id', 'quit_time'],
'=' => ['uid', 'lead_admin_id', 'connect_id'],
];
}
@ -55,8 +55,15 @@ class OaPersonalQuitLists extends BaseAdminDataLists implements ListsSearchInter
*/
public function lists(): array
{
return OaPersonalQuit::where($this->searchWhere)
->limit($this->limitOffset, $this->limitLength)
$query = OaPersonalQuit::where($this->searchWhere);
if (!empty($this->params['uid_name'])) {
$userIds = Admin::whereLike('name', $this->params['uid_name'])->column('id');
$query->whereIn('uid', $userIds);
}
if (!empty($this->params['quit_time'])) {
$query->whereTime('quit_time', $this->params['quit_time']);
}
return $query->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc'])
->select()->each(function($data){
$user = Admin::where('id',$data['uid'])->findOrEmpty();
@ -79,7 +86,15 @@ class OaPersonalQuitLists extends BaseAdminDataLists implements ListsSearchInter
*/
public function count(): int
{
return OaPersonalQuit::where($this->searchWhere)->count();
$query = OaPersonalQuit::where($this->searchWhere);
if (!empty($this->params['uid_name'])) {
$userIds = Admin::whereLike('name', $this->params['uid_name'])->column('id');
$query->whereIn('uid', $userIds);
}
if (!empty($this->params['quit_time'])) {
$query->whereTime('quit_time', $this->params['quit_time']);
}
return $query->count();
}
}

View File

@ -49,7 +49,7 @@ class OaExamineTempLogic extends BaseLogic
'examine_type' => $params['examine_type'],
'temp_name' => $params['temp_name'],
'create_user' => $params['create_user'],
'create_time' => !empty($params['create_time']) ? strtotime($params['create_time']) : 0
'create_time' => !empty($params['create_time']) ? strtotime($params['create_time']) : time()
]);
foreach($params['detail'] as &$v){
$v['examine_temp_id'] = $res['id'];
@ -80,8 +80,6 @@ class OaExamineTempLogic extends BaseLogic
OaExamineTemp::where('id', $params['id'])->update([
'examine_type' => $params['examine_type'],
'temp_name' => $params['temp_name'],
'create_user' => $params['create_user'],
'create_time' => !empty($params['create_time']) ? strtotime($params['create_time']) : 0,
'update_time' => time()
]);
foreach($params['detail'] as $v){

View File

@ -111,6 +111,7 @@ class OaWorkRecordLogic extends BaseLogic
{
$data = OaWorkRecord::findOrEmpty($params['id']);
$work = OaWork::field('type,type_user,works,plans,remark,annex')->where('id',$data['wid'])->findOrEmpty();
$work['annex'] = empty($work['annex']) ? [] : json_decode($work['annex'], true);
$type_user = Admin::where('id','in',$work['type_user'])->column('name');
$work['type_user_names'] = implode(',',$type_user);
$work['type_text'] = $work->type_text;

View File

@ -38,7 +38,6 @@ class OaExamineTempValidate extends BaseValidate
'examine_type' => 'require|checkExamineType',
'temp_name' => 'require',
'create_user' => 'require',
'create_time' => 'require|dateFormat:Y-m-d H:i:s',
'detail' => 'require|checkDetail'
];
@ -65,7 +64,7 @@ class OaExamineTempValidate extends BaseValidate
*/
public function sceneAdd()
{
return $this->only(['examine_type','temp_name','create_user','create_time','detail']);
return $this->only(['examine_type','temp_name','detail']);
}
@ -77,7 +76,7 @@ class OaExamineTempValidate extends BaseValidate
*/
public function sceneEdit()
{
return $this->only(['id','examine_type','temp_name','create_user','create_time','detail']);
return $this->only(['id','examine_type','temp_name','create_user','detail']);
}

View File

@ -13,7 +13,6 @@
'income_month' => 'require|dateFormat:Y-m',
'expense_time' => 'require|dateFormat:Y-m-d',
'flow_id' => 'require|checkFlow',
'annex' => 'checkAnnex',
'detail' => 'require|checkDetail',
];

View File

@ -22,7 +22,6 @@
'invoice_account' => 'number',
'flow_id' => 'require|checkFlow',
'check_remark' => 'require',
'annex' => 'checkAnnex',
];

View File

@ -35,7 +35,6 @@ class OaWorkValidate extends BaseValidate
'type' => 'require|integer|in:1,2,3',
'type_user' => 'require|checkTypeUser',
'works' => 'require',
'annex' => 'checkAnnex',
];

View File

@ -74,6 +74,11 @@ return [
'wmv', 'avi', 'mpg', 'mpeg', '3gp', 'mov', 'mp4', 'flv', 'f4v', 'rmvb', 'mkv'
],
// 文件上传限制 (文件)
'file_file' => [
'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'pdf', 'txt', 'zip','rar','tar','jpg', 'png', 'gif', 'jpeg', 'webp','wmv', 'avi', 'mpg', 'mpeg', '3gp', 'mov', 'mp4', 'flv', 'f4v', 'rmvb', 'mkv'
],
// 登录设置
'login' => [
// 登录方式1-账号密码登录2-手机短信验证码登录