sugangqiang 2 年之前
父节点
当前提交
5540e6e445

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

@@ -7,7 +7,7 @@ use app\common\model\IntegralItem;
 class IntegralItemApi {
 class IntegralItemApi {
 
 
     public static function getOne($id) {
     public static function getOne($id) {
-        return IntegralItem::findOrEmpty($id);
+        return IntegralItem::alias("i")->leftJoin("new_integral_project p", "p.id=i.projectId")->field("i.*,p.type,if(yearly > 0,yearly,0) as plan")->findOrEmpty($id);
     }
     }
 
 
     public static function getList($params) {
     public static function getList($params) {
@@ -40,7 +40,7 @@ class IntegralItemApi {
         $data["fstGainPoints"] = $params["fstGainPoints"];
         $data["fstGainPoints"] = $params["fstGainPoints"];
         $data["fileTypeId"] = implode(",", $params["fileTypeId"]);
         $data["fileTypeId"] = implode(",", $params["fileTypeId"]);
         $data["active"] = $params["active"];
         $data["active"] = $params["active"];
-        if (!$params["plan"] == 2) {
+        if ($params["plan"] == 2) {
             $data["stepNeedAmount"] = $params["stepNeedAmount"];
             $data["stepNeedAmount"] = $params["stepNeedAmount"];
             $data["stepGainPoints"] = $params["stepGainPoints"];
             $data["stepGainPoints"] = $params["stepGainPoints"];
             $data["maxGainPoints"] = $params["maxGainPoints"];
             $data["maxGainPoints"] = $params["maxGainPoints"];
@@ -49,7 +49,7 @@ class IntegralItemApi {
             $data["stepNeedAmount"] = 0;
             $data["stepNeedAmount"] = 0;
             $data["stepGainPoints"] = 0;
             $data["stepGainPoints"] = 0;
             $data["maxGainPoints"] = 0;
             $data["maxGainPoints"] = 0;
-            $data["yearly"] = 1;
+            $data["yearly"] = 0;
         }
         }
         if ($params["id"]) {
         if ($params["id"]) {
             $data["id"] = $params["id"];
             $data["id"] = $params["id"];

+ 4 - 0
public/static/modular/talentIdentify/integralMgr/IntegralItemMgr_info.js

@@ -149,6 +149,8 @@ IntegralItemMgrInfo.onTypeChange = function () {
         "type": "GET",
         "type": "GET",
         "url": "/admin/integral_mgr/getProjectsByType/type/" + type
         "url": "/admin/integral_mgr/getProjectsByType/type/" + type
     });
     });
+    var projectId = $("#projectId").attr("selectVal");
+    $("#projectId").val(projectId);
     Feng.addAjaxSelect({
     Feng.addAjaxSelect({
         "id": "fileTypeId",
         "id": "fileTypeId",
         "displayCode": "id",
         "displayCode": "id",
@@ -244,6 +246,8 @@ $(function () {
     $("select").each(function () {
     $("select").each(function () {
         $(this).val($(this).attr("selectVal"));
         $(this).val($(this).attr("selectVal"));
     });
     });
+    IntegralItemMgrInfo.onTypeChange();
+    IntegralItemMgrInfo.onIntegralPlanChange();
     
     
     $("#fileTypeId").chosen({
     $("#fileTypeId").chosen({
         no_results_text: "没有找到结果!",
         no_results_text: "没有找到结果!",