|
|
@@ -17,12 +17,20 @@ class CpItemController extends BaseController
|
|
|
{
|
|
|
$get = Yii::$app->request->get();
|
|
|
$cpId = $get['cpId'] ?? 0;
|
|
|
+ $search = $get['search'] ?? '';
|
|
|
$mainId = $this->mainId ?? 0;
|
|
|
$where = [];
|
|
|
$where['mainId'] = $mainId;
|
|
|
if (!empty($cpId)) {
|
|
|
$where['cpId'] = $cpId;
|
|
|
}
|
|
|
+ if (!empty($search)) {
|
|
|
+ if (stringUtil::isLetter($search)) {
|
|
|
+ $where['py'] = $search;
|
|
|
+ } else {
|
|
|
+ $where['name'] = $search;
|
|
|
+ }
|
|
|
+ }
|
|
|
$respond = CpItemClass::getItemList($where);
|
|
|
util::success($respond);
|
|
|
}
|