yingzi 2 years ago
parent
commit
c9166ae482
2 changed files with 13 additions and 3 deletions
  1. 8 0
      app/model/api/ShowTemplate.php
  2. 5 3
      app/system/controller/ShowTemplate.php

+ 8 - 0
app/model/api/ShowTemplate.php

@@ -59,4 +59,12 @@ class ShowTemplate extends Model
         
         return ["list" => $data, "pageSize" => $post["pageSize"],"page"=>$post["page"],"totalCount"=>$totalCount];
     }
+    
+    /**
+     * 添加编辑
+     * @param type $post
+     */
+    public function save($post){
+        
+    }
 }

+ 5 - 3
app/system/controller/ShowTemplate.php

@@ -54,6 +54,7 @@ class ShowTemplate extends  BaseController{
             ['imgs',[]],
             ['is_hot','0'],
             ['is_recommend','0'],
+            ['is_init','0'],
             ['code','','empty','请输入CODE'],
             ['status','0'],
             ['unreal_sales','0'],
@@ -62,10 +63,11 @@ class ShowTemplate extends  BaseController{
         $save["title"]        = $post["title"];
         $save["price"]        = floatval($post["price"]);
         $save["old_price"]    = floatval($post["old_price"]);
-        $save["status"]       = (int)$post["status"]==1?1:0;
+        $save["status"]       = (int)$post["status"]      == 1 ? 1 : 0;
         $save["imgs"]         = empty($post["imgs"]) ? "" : implode(",", $post["imgs"]);
-        $save["is_hot"]       = (int)$post["is_hot"]==1?1:0;
-        $save["is_recommend"] = (int)$post["is_recommend"]==1?1:0;
+        $save["is_hot"]       = (int)$post["is_hot"]      == 1 ? 1 : 0;
+        $save["is_recommend"] = (int)$post["is_recommend"]== 1 ? 1 : 0;
+        $save["is_init"]      = (int)$post["is_init"]     == 1 ? 1 : 0;
         $save["code"]         = $post["code"];
         $save["unreal_sales"] = (int)$post["unreal_sales"];
         $save["admin_time"]   = time();