no message
This commit is contained in:
parent
53d86e47f1
commit
32669be764
@ -79,41 +79,42 @@ class Book extends Model
|
|||||||
|
|
||||||
$oSelf = self::where("path", $sPath)->where("is_del", $iIsDel);
|
$oSelf = self::where("path", $sPath)->where("is_del", $iIsDel);
|
||||||
|
|
||||||
if (isset($aRagOption["where"])) {
|
|
||||||
$oSelf = $oSelf->whereRaw($aRagOption["where"]);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($oParentRag->sort) {
|
// where
|
||||||
$aSort = explode("_", $oParentRag->sort);
|
if ($iPage !== "all") {
|
||||||
$oSelf = $oSelf->where($aSort[0], $aSort[1]);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($oParentRag->order == "rank_todo") {
|
// sort覆盖特殊规则
|
||||||
$sTodoOrder = BookOption::_hit("order_rank_todo");
|
if ($oParentRag->sort) {
|
||||||
$aOrder = explode(",", $sTodoOrder);
|
|
||||||
|
|
||||||
if ($iPage !== "all") {
|
$aSort = explode("_", $oParentRag->sort);
|
||||||
|
$oSelf = $oSelf->where($aSort[0], $aSort[1]);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
if (isset($aRagOption["where"])) {
|
||||||
|
$oSelf = $oSelf->whereRaw($aRagOption["where"]);
|
||||||
|
}
|
||||||
|
|
||||||
if (isset($aRagOption["todo_show_type"])) {
|
if (isset($aRagOption["todo_show_type"])) {
|
||||||
|
$oSelf = $oSelf->where("rank", "!=", "done");
|
||||||
if ($aRagOption["todo_show_type"] == "A") {
|
$oSelf = $oSelf->where("rank", "!=", "block");
|
||||||
$oSelf = $oSelf->where("rank", "!=", "done");
|
|
||||||
$oSelf = $oSelf->where("rank", "!=", "block");
|
|
||||||
} else if ($aRagOption["todo_show_type"] == "B") {
|
|
||||||
$oSelf = $oSelf->whereIn("rank", ["done", "block"]);
|
|
||||||
} else if ($aRagOption["todo_show_type"] == "AB") {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($oParentRag->order == "rank_todo") {
|
||||||
|
|
||||||
|
$sTodoOrder = BookOption::_hit("order_rank_todo");
|
||||||
|
$aOrder = explode(",", $sTodoOrder);
|
||||||
|
|
||||||
$oSelf = $oSelf->orderByRaw("rank IS NULL, FIELD(rank, " . $sTodoOrder . ") ".$sOrderType);
|
$oSelf = $oSelf->orderByRaw("rank IS NULL, FIELD(rank, " . $sTodoOrder . ") ".$sOrderType);
|
||||||
$oSelf = $oSelf->orderByRaw("fire IS NULL, fire ASC");
|
$oSelf = $oSelf->orderByRaw("fire IS NULL, fire ASC");
|
||||||
|
|
||||||
$sOrder = "no";
|
$sOrder = "no";
|
||||||
$sOrderType = "asc";
|
$sOrderType = "asc";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$oSelf = $oSelf->orderBy($sOrder, $sOrderType);
|
$oSelf = $oSelf->orderBy($sOrder, $sOrderType);
|
||||||
@ -121,11 +122,14 @@ class Book extends Model
|
|||||||
$oSelf = $oSelf->orderBy("updated_at", "desc");
|
$oSelf = $oSelf->orderBy("updated_at", "desc");
|
||||||
|
|
||||||
if ($iPage == "all") {
|
if ($iPage == "all") {
|
||||||
$oSelf = $oSelf->get();
|
|
||||||
} else {
|
|
||||||
$oSelf = $oSelf->paginate($iLimit, ['*'], 'page', $iPage);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
$oSelf = $oSelf->get();
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
$oSelf = $oSelf->paginate($iLimit, ['*'], 'page', $iPage);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return $oSelf;
|
return $oSelf;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user