yijia-webman/app/model/pms/Task.php

34 lines
1011 B
PHP

<?php
namespace app\model\pms;
class Task extends Base
{
//protected $table = 'crm_customer';
public static $statusList = [
'wait' => '未开始',
'doing' => '进行中',
'done' => '已完成',
'pause' => '已暂停',
'cancel' => '已取消',
'closed' => '已关闭',
];
public static function getList($size = 20)
{
return self::alias('t')
->leftJoin('user u', 't.assignedTo = u.account')
->leftjoin('user u2', 't.finishedBy = u2.account')
->leftJoin('project p', 't.project = p.id')
->leftJoin('project p2', 't.execution = p2.id')
->where('t.deleted', 0)
->where('t.status', 'not in', ['closed', 'cancel'])
->order('t.id desc')
->field('t.*, u.realname as assignedToName, u2.realname as finishedByName, p.name as projectName, p2.name as executionName')
->paginate([
'list_rows'=> $size,
'var_page' => 'page',
]);
}
}