chuweiqiang 1 рік тому
батько
коміт
e7b6460b31

+ 3 - 0
application/admin/controller/books/Books.php

@@ -139,6 +139,9 @@ class Books extends Backend
                 $validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.add' : $name) : $this->modelValidate;
                 $this->model->validateFailException()->validate($validate);
             }
+            $params['free_start_time'] = date("Y-m-d H:i:s");
+            $params['free_end_time'] = $params["effective_time"];
+            $params['status'] = 1;
             $result = $this->model->allowField(true)->save($params);
             Db::commit();
         } catch (ValidateException|PDOException|Exception $e) {

+ 6 - 6
application/admin/view/books/certificate/add.html

@@ -54,12 +54,12 @@
 
 <!--        </div>-->
 <!--    </div>-->
-    <div class="form-group">
-        <label class="control-label col-xs-12 col-sm-2">{:__('Free_day')}:</label>
-        <div class="col-xs-12 col-sm-8">
-            <input id="c-free_day" class="form-control" name="row[free_day]" type="number">
-        </div>
-    </div>
+<!--    <div class="form-group">-->
+<!--        <label class="control-label col-xs-12 col-sm-2">{:__('Free_day')}:</label>-->
+<!--        <div class="col-xs-12 col-sm-8">-->
+<!--            <input id="c-free_day" class="form-control" name="row[free_day]" type="number">-->
+<!--        </div>-->
+<!--    </div>-->
     <div class="form-group layer-footer">
         <label class="control-label col-xs-12 col-sm-2"></label>
         <div class="col-xs-12 col-sm-8">