shish 2 lat temu
rodzic
commit
a18cec0448
1 zmienionych plików z 8 dodań i 2 usunięć
  1. 8 2
      app-ghs/controllers/CpController.php

+ 8 - 2
app-ghs/controllers/CpController.php

@@ -20,8 +20,14 @@ class CpController extends BaseController
         $search = $get['search'] ?? '';
         $mainId = $this->mainId ?? 0;
         $where = [];
+        $requestType = $get['del'] ?? 'cp';
         $where['mainId'] = $mainId;
-        $where['delStatus'] = 0;
+        if ($requestType == 'cp') {
+            $where['delStatus'] = 0;
+        }
+        if ($requestType == 'del') {
+            $where['delStatus'] = 1;
+        }
         if (!empty($search)) {
             if (stringUtil::isLetter($search)) {
                 $where['py'] = ['like', $search];
@@ -94,7 +100,7 @@ class CpController extends BaseController
     {
         $get = Yii::$app->request->get();
         $id = $get['id'] ?? 0;
-        $cp = CpClass::getById($id,true);
+        $cp = CpClass::getById($id, true);
         if (isset($cp->mainId) == false || $cp->mainId != $this->mainId) {
             util::fail('无法查看');
         }