项目列表按创建日期倒序

Signed-off-by: vilson <545522390@qq.com>
This commit is contained in:
vilson 2019-06-15 09:24:59 +08:00
parent 5a1b1e09e6
commit c8c90b007e

View File

@ -53,10 +53,10 @@ class Project extends BasicApi
$orgCode = getCurrentOrganizationCode();
if ($type == 'my' || $type == 'other') {
$sql = "select * from {$prefix}project as pp join {$prefix}project_member as pm on pm.project_code = pp.code where pp.organization_code = '{$orgCode}' and (pm.member_code = '{$memberCode}' or pp.private = 0) group by pp.`code`";
$sql = "select * from {$prefix}project as pp join {$prefix}project_member as pm on pm.project_code = pp.code where pp.organization_code = '{$orgCode}' and (pm.member_code = '{$memberCode}' or pp.private = 0) group by pp.`code` order by pp.id desc";
$list = CommonModel::limitByQuery($sql, $page, $pageSize);
} else {
$sql = "select * from {$prefix}project as pp join {$prefix}project_collection as pc on pc.project_code = pp.code where pp.organization_code = '{$orgCode}' and pc.member_code = '{$memberCode}' group by pp.`code`";
$sql = "select * from {$prefix}project as pp join {$prefix}project_collection as pc on pc.project_code = pp.code where pp.organization_code = '{$orgCode}' and pc.member_code = '{$memberCode}' group by pp.`code` order by pc.id desc";
$list = CommonModel::limitByQuery($sql, $page, $pageSize);
}
$newList = [];