|
@@ -94,11 +94,19 @@ class DictApi {
|
|
|
$offset = trim($request->param("offset")) ?: 0;
|
|
|
$limit = trim($request->param("limit")) ?: 10;
|
|
|
$name = trim($request->param("condition"));
|
|
|
+ $item = trim($request->param("item"));
|
|
|
$where = [];
|
|
|
$where[] = ["pid", "=", "0"];
|
|
|
if ($name) {
|
|
|
$where[] = ["name", "like", "%" . $name . "%"];
|
|
|
}
|
|
|
+ if ($item) {
|
|
|
+ $_where[] = ["pid", "<>", "0"];
|
|
|
+ $_where[] = ["name", "like", "%" . $item . "%"];
|
|
|
+ $ids = Dict::where($_where)->column("pid");
|
|
|
+ $ids = array_unique($ids);
|
|
|
+ $where[] = ["id", "in", $ids];
|
|
|
+ }
|
|
|
$count = Dict::where($where)->count();
|
|
|
$list = Dict::where($where)->limit($offset, $limit)->order("id " . $order)->select()->toArray();
|
|
|
foreach ($list as &$item) {
|