增加成员任务、项目查看
Signed-off-by: vilson <545522390@qq.com>
This commit is contained in:
parent
5c1ead0291
commit
62b4ab889d
@ -397,7 +397,11 @@ class Task extends CommonModel
|
|||||||
$offset = ($page - 1) * $page;
|
$offset = ($page - 1) * $page;
|
||||||
$limit = $pageSize;
|
$limit = $pageSize;
|
||||||
$prefix = config('database.prefix');
|
$prefix = config('database.prefix');
|
||||||
$sql = "select *,t.id as id,t.name as name,t.code as code from {$prefix}task as t join {$prefix}project as p on t.project_code = p.code where t.done = {$done} and t.deleted = 0 and t.assign_to = '{$memberCode}' and p.deleted = 0 order by t.id desc";
|
$doneSql = '';
|
||||||
|
if ($done != -1) {
|
||||||
|
$doneSql = " and t.done = {$done}";
|
||||||
|
}
|
||||||
|
$sql = "select *,t.id as id,t.name as name,t.code as code from {$prefix}task as t join {$prefix}project as p on t.project_code = p.code where t.deleted = 0 {$doneSql} and t.assign_to = '{$memberCode}' and p.deleted = 0 order by t.id desc";
|
||||||
$total = Db::query($sql);
|
$total = Db::query($sql);
|
||||||
$total = count($total);
|
$total = count($total);
|
||||||
$sql .= " limit {$offset},{$limit}";
|
$sql .= " limit {$offset},{$limit}";
|
||||||
|
@ -103,7 +103,7 @@ class Project extends BasicApi
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取自己的任务
|
* 获取自己的项目
|
||||||
* @throws \think\db\exception\DataNotFoundException
|
* @throws \think\db\exception\DataNotFoundException
|
||||||
* @throws \think\db\exception\ModelNotFoundException
|
* @throws \think\db\exception\ModelNotFoundException
|
||||||
* @throws \think\exception\DbException
|
* @throws \think\exception\DbException
|
||||||
@ -111,7 +111,12 @@ class Project extends BasicApi
|
|||||||
public function selfList()
|
public function selfList()
|
||||||
{
|
{
|
||||||
$type = Request::post('type');
|
$type = Request::post('type');
|
||||||
$member = getCurrentMember();
|
$memberCode = Request::post('memberCode', '');
|
||||||
|
if (!$memberCode) {
|
||||||
|
$member = getCurrentMember();
|
||||||
|
} else {
|
||||||
|
$member = Member::where(['code' => $memberCode])->find();
|
||||||
|
}
|
||||||
$deleted = 1;
|
$deleted = 1;
|
||||||
if (!$type) {
|
if (!$type) {
|
||||||
$deleted = 0;
|
$deleted = 0;
|
||||||
|
@ -81,12 +81,18 @@ class Task extends BasicApi
|
|||||||
*/
|
*/
|
||||||
public function selfList()
|
public function selfList()
|
||||||
{
|
{
|
||||||
$type = Request::post('type');
|
$type = Request::post('type', 0);
|
||||||
$member = getCurrentMember();
|
$memberCode = Request::post('memberCode', '');
|
||||||
|
if (!$memberCode) {
|
||||||
|
$member = getCurrentMember();
|
||||||
|
} else {
|
||||||
|
$member = Member::where(['code' => $memberCode])->find();
|
||||||
|
}
|
||||||
$done = 1;
|
$done = 1;
|
||||||
if (!$type) {
|
if (!$type) {
|
||||||
$done = 0;
|
$done = 0;
|
||||||
}
|
}
|
||||||
|
$type == -1 && $done = $type;
|
||||||
$list = $this->model->getMemberTasks($member['code'], $done, Request::post('page'), Request::post('pageSize'));
|
$list = $this->model->getMemberTasks($member['code'], $done, Request::post('page'), Request::post('pageSize'));
|
||||||
if ($list['list']) {
|
if ($list['list']) {
|
||||||
foreach ($list['list'] as &$task) {
|
foreach ($list['list'] as &$task) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user