sugangqiang 2 năm trước cách đây
mục cha
commit
6a7fc3c8d7

+ 8 - 0
app/admin/controller/IntegralMgr.php

@@ -155,4 +155,12 @@ class IntegralMgr extends AdminController {
         }
     }
 
+    public function getProjectsByType() {
+        $type = $this->request->param("type") ?: 0;
+        $where[] = ["type", "=", $type];
+        $where[] = ["active", "=", 1];
+        $list = IntegralProjectApi::getAll($where);
+        return json($list);
+    }
+
 }

+ 1 - 1
app/common/api/IntegralItemApi.php

@@ -26,7 +26,7 @@ class IntegralItemApi {
         return ["total" => $count, "rows" => $list];
     }
 
-    public static function getAll() {
+    public static function getAll($where = []) {
         $where[] = ["delete", "=", 0];
         $list = IntegralItem::where($where)->order("updateTime desc,createTime desc")->select()->toArray();
         return $list;

+ 1 - 1
app/common/api/IntegralProjectApi.php

@@ -32,7 +32,7 @@ class IntegralProjectApi {
         return ["total" => $count, "rows" => $list];
     }
 
-    public static function getAll() {
+    public static function getAll($where = []) {
         $where[] = ["delete", "=", 0];
         $list = IntegralProject::where($where)->order("updateTime desc,createTime desc")->select()->toArray();
         return $list;

+ 8 - 1
public/static/modular/talentIdentify/integralMgr/IntegralItemMgr_info.js

@@ -141,7 +141,14 @@ IntegralItemMgrInfo.collectData = function () {
 }
 
 IntegralItemMgrInfo.onTypeChange = function () {
-
+    var type = $("#type").val();
+    Feng.addAjaxSelect({
+        "id": "projectId",
+        "displayCode": "id",
+        "displayName": "name",
+        "type": "GET",
+        "url": "/admin/integral_mgr/getProjectsByType/type/" + type
+    });
 }
 
 //切换积分方案