fix:项目管理功能需求

This commit is contained in:
ldjun
2026-03-18 14:02:51 +08:00
parent 26f71a4834
commit b7a7e27a53
9 changed files with 125 additions and 36 deletions

View File

@@ -87,6 +87,56 @@ class Hr extends Common
return $this->sendSuccess($StaffList); return $this->sendSuccess($StaffList);
} }
public function GetStaffPage()
{
$param = request()->post();
$currPage = isset($param['currPage']) ? $param['currPage'] : 1;
$pageSize = isset($param['pageSize']) ? $param['pageSize'] : 20;
$result = db('hr_staff')->alias('i')
->join('hr_staff_type t', 'i.staff_type=t.id', 'left')
->where('i.del_time',null)
->field('i.*, t.desp as staff_type_desp')
->page($currPage, $pageSize)
->select();
$total = db('hr_staff')->alias('i')
->join('hr_staff_type t', 'i.staff_type=t.id', 'left')
->where('i.del_time',null)
->field('i.*, t.desp as staff_type_desp')
->count();
//查找员工所属部门信息
for ($i=0; $i<count($result); $i++)
{
$dept_arr = explode(",", $result[$i]['staff_dept']);
$dept_desp = db('hr_dept')->where('dept_id', 'in', $dept_arr)->column('dept_name');
$result[$i]['staff_dept_desp'] = implode(',', $dept_desp);
}
$StaffList = [];
if (isset($param['type']))
{
for ($i=0; $i<count($result); $i++)
{
$dept_arr = explode(",", $result[$i]['staff_dept']);
if (in_array($param['type'], $dept_arr))
{
$StaffList[] = $result[$i];
}
}
}
else
{
$StaffList = $result;
}
$res['list'] = $StaffList;
$res['total'] = $total;
return $this->sendSuccess($res);
}
//获取项目部门所有的员工信息 //获取项目部门所有的员工信息
public function GetProjectDeptStaffList() public function GetProjectDeptStaffList()

View File

@@ -197,7 +197,18 @@ class Project extends Common
{ {
$ProjectInfo['project_manager'] = $ret['staff_name']; $ProjectInfo['project_manager'] = $ret['staff_name'];
} }
$ProjectInfo['sale_name'] = '';
if (!empty($ProjectInfo['sale_manager'])){
$retSale = db('system_user')->alias('u')
->join('hr_staff s','s.staff_id=u.user_id', 'left')
->where('u.user_type', 1)
->where('u.id', $ProjectInfo['sale_manager'])
->find();
if (null != $retSale)
{
$ProjectInfo['sale_name'] = $retSale['staff_name'];
}
}
return $this->sendSuccess($ProjectInfo); return $this->sendSuccess($ProjectInfo);
} }
@@ -286,6 +297,14 @@ class Project extends Common
$ret = db('project_info')->where('project_id',$param['project_id'])->update($update); $ret = db('project_info')->where('project_id',$param['project_id'])->update($update);
return $this->sendSuccess('更新成功'); return $this->sendSuccess('更新成功');
} }
public function UpdateSaleManager()
{
$param = request()->post();
$update['sale_manager'] = $param['sale_manager']; //数组转字符串
$ret = db('project_info')->where('project_id',$param['project_id'])->update($update);
return $this->sendSuccess('更新成功');
}

View File

@@ -49,23 +49,31 @@ class Story extends Common
$members = explode(',', $opStory['story_member']); $members = explode(',', $opStory['story_member']);
$opStory['story_members'] = ''; $opStory['story_members'] = '';
$ret = [];
for ($i=0; $i<count($members); $i++)
{
$user_info = $user->GetUserInfoByLoginId($members[$i]);
if ($user_info && isset($user_info['name'])) {
$ret[] = $user_info['name'];
}
}
$opStory['story_members'] = implode(',', $ret);
$opStory['story_managers'] = ''; $opStory['story_members'] = '';
if ($opStory['story_manager'] !== null) { if (count($members)>0)
$user_info = $user->GetUserInfoByLoginId($opStory['story_manager']); {
if ($user_info && isset($user_info['name'])) { $ret = db('system_user')->alias('u')
$opStory['story_managers'] = $user_info['name']; ->join('hr_staff s','s.staff_id=u.user_id', 'left')
} ->where('u.user_type', 1)
->where('u.id', 'in', $members)
->column('s.staff_name');
$opStory['story_members'] = implode(',', $ret); //数组转字符串
} }
$opStory['story_managername'] = '';
$ret = db('system_user')->alias('u')
->join('hr_staff s','s.staff_id=u.user_id', 'left')
->where('u.user_type', 1)
->where('u.id', $opStory['story_manager'])
->find();
if (null != $ret)
{
$opStory['story_managername'] = $ret['staff_name'];
}
$result[] = $opStory; $result[] = $opStory;
} }

View File

@@ -42,7 +42,7 @@ class User extends Common
->find(); ->find();
if ($ret != null) if ($ret != null)
{ {
$ret['company'] = "苏州维达奇智能科技有限公司"; $ret['company'] = "上海诺力智能科技有限公司";
} }
} }
//客户 //客户
@@ -318,7 +318,7 @@ class User extends Common
->find(); ->find();
if ($ret != null) if ($ret != null)
{ {
$ret['company'] = "苏州维达奇智能科技有限公司"; $ret['company'] = "上海诺力智能科技有限公司";
} }
$ret['id'] = $login_id; $ret['id'] = $login_id;
$ret['name'] = $res['user_name']; $ret['name'] = $res['user_name'];

View File

@@ -298,6 +298,15 @@ class Project extends Common
return $this->sendSuccess('更新成功'); return $this->sendSuccess('更新成功');
} }
public function UpdateSaleManager()
{
$param = request()->post();
$update['sale_manager'] = $param['sale_manager']; //数组转字符串
$ret = db('project_info')->where('project_id',$param['project_id'])->update($update);
return $this->sendSuccess('更新成功');
}
//添加项目外部成员 //添加项目外部成员
public function AddProjectExternalMember() public function AddProjectExternalMember()
{ {

View File

@@ -42,7 +42,7 @@ class User extends Common
->find(); ->find();
if ($ret != null) if ($ret != null)
{ {
$ret['company'] = "苏州维达奇智能科技有限公司"; $ret['company'] = "上海诺力智能科技有限公司";
} }
} }
//客户 //客户
@@ -318,7 +318,7 @@ class User extends Common
->find(); ->find();
if ($ret != null) if ($ret != null)
{ {
$ret['company'] = "苏州维达奇智能科技有限公司"; $ret['company'] = "上海诺力智能科技有限公司";
} }
$ret['id'] = $login_id; $ret['id'] = $login_id;
} }

View File

@@ -13,13 +13,13 @@ return [
// 数据库类型 // 数据库类型
'type' => 'mysql', 'type' => 'mysql',
// 服务器地址 // 服务器地址
'hostname' => '127.0.0.1', 'hostname' => '192.168.81.251',
// 数据库名 // 数据库名
'database' => 'oms', 'database' => 'oms',
// 用户名 // 用户名
'username' => 'root', 'username' => 'root',
// 密码 // 密码
'password' => '12356', 'password' => 'P@ssw0rd.',
// 端口 // 端口
'hostport' => '', 'hostport' => '',
// 连接dsn // 连接dsn

View File

@@ -26,7 +26,7 @@
"topthink/think-oracle": "1.*", "topthink/think-oracle": "1.*",
"phpoffice/phpexcel": "^1.8", "phpoffice/phpexcel": "^1.8",
"aliyuncs/oss-sdk-php": "^2.3", "aliyuncs/oss-sdk-php": "^2.3",
"topthink/think-worker": "^3.0" "topthink/think-worker": "^1.0"
}, },
"autoload": { "autoload": {
"psr-4": { "psr-4": {
@@ -37,6 +37,9 @@
"think-path": "thinkphp" "think-path": "thinkphp"
}, },
"config": { "config": {
"preferred-install": "dist" "preferred-install": "dist",
"allow-plugins": {
"topthink/think-installer": true
}
} }
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB