+ add pdfirst and qdfirst.

This commit is contained in:
wangchunsheng
2012-12-17 07:09:42 +00:00
parent 318b9f450c
commit 3f7260fb8b

View File

@@ -72,8 +72,10 @@ class userModel extends model
*/
$fields = 'account, realname';
if(strpos($params, 'pofirst') !== false) $fields .= ", INSTR(',pd,po,', role) AS roleOrder";
if(strpos($params, 'pdfirst') !== false) $fields .= ", INSTR(',po,pd,', role) AS roleOrder";
if(strpos($params, 'devfirst')!== false) $fields .= ", INSTR(',td,pm,dev,', role) AS roleOrder";
if(strpos($params, 'qafirst') !== false) $fields .= ", INSTR(',qd,qa,', role) AS roleOrder";
if(strpos($params, 'qdfirst') !== false) $fields .= ", INSTR(',qa,qd,', role) AS roleOrder";
if(strpos($params, 'pmfirst') !== false) $fields .= ", INSTR(',td,pm,', role) AS roleOrder";
$orderBy = strpos($params, 'first') !== false ? 'roleOrder DESC, account' : 'account';