shish 2 жил өмнө
parent
commit
9f322a7328

+ 6 - 1
app-pt/controllers/ItemController.php

@@ -2,6 +2,7 @@
 
 namespace pt\controllers;
 
+use biz\cp\classes\PtCpItemClass;
 use common\components\stringUtil;
 use  Yii;
 use common\components\util;
@@ -22,7 +23,11 @@ class ItemController extends BaseController
             $where['classId'] = $classId;
         }
         if (!empty($cpId) && $cpId > 0) {
-            $where['cpId'] = $cpId;
+            $ptCpItemList = PtCpItemClass::getAllByCondition(['cpId' => $cpId], null, 'itemId');
+            if (!empty($ptCpItemList)) {
+                $ids = array_column($ptCpItemList, 'itemId');
+                $where['id'] = ['in', $ids];
+            }
         }
         if ($cpClassStyle == 0) {
             $where['hasCpId'] = 0;