作者 董瑞恩
1 个管道 的构建 通过 耗费 1 秒

cost

@@ -11,6 +11,8 @@ namespace app\portal\controller; @@ -11,6 +11,8 @@ namespace app\portal\controller;
11 11
12 use app\portal\model\EquipmentModel; 12 use app\portal\model\EquipmentModel;
13 use cmf\controller\AdminBaseController; 13 use cmf\controller\AdminBaseController;
  14 +use think\Db;
  15 +
14 /** 16 /**
15 * Class AdminCostController 17 * Class AdminCostController
16 * @package app\portal\controller 18 * @package app\portal\controller
@@ -27,9 +29,10 @@ use cmf\controller\AdminBaseController; @@ -27,9 +29,10 @@ use cmf\controller\AdminBaseController;
27 class AdminCostController extends AdminBaseController{ 29 class AdminCostController extends AdminBaseController{
28 30
29 public function index(){ 31 public function index(){
30 - $Equipment=new EquipmentModel();  
31 - $data=$Equipment->paginate(10);  
32 - $this->assign('data',$data); 32 + $cost=Db::name('cost')->where('id',1)->find();
  33 + $interval = Db::name('interval')->where('id',1)->find();
  34 + $this->assign('cost',$cost);
  35 + $this->assign('interval',$interval);
33 return $this->fetch(); 36 return $this->fetch();
34 } 37 }
35 } 38 }
@@ -10,7 +10,7 @@ @@ -10,7 +10,7 @@
10 <ul class="nav nav-tabs"> 10 <ul class="nav nav-tabs">
11 <li class="active"><a>费用管理</a></li> 11 <li class="active"><a>费用管理</a></li>
12 </ul> 12 </ul>
13 - <form action="{:url('AdminArticle/editPost')}" method="post" class="form-horizontal js-ajax-form margin-top-20"> 13 + <form action="{:url('AdminCost/editPost')}" method="post" class="form-horizontal js-ajax-form margin-top-20">
14 <div class="row"> 14 <div class="row">
15 <div class="col-md-3"> 15 <div class="col-md-3">
16 <table class="table table-bordered"> 16 <table class="table table-bordered">
@@ -19,7 +19,7 @@ @@ -19,7 +19,7 @@
19 </tr> 19 </tr>
20 <tr> 20 <tr>
21 <td> 21 <td>
22 - <label><input type="checkbox" name="ty1" value="">第一小时免费</label><br/> 22 + <label><input type="checkbox" name="free" value="" checked>第一小时免费</label><br/>
23 </td> 23 </td>
24 </tr> 24 </tr>
25 <tr> 25 <tr>
@@ -27,7 +27,7 @@ @@ -27,7 +27,7 @@
27 </tr> 27 </tr>
28 <tr> 28 <tr>
29 <td> 29 <td>
30 - 每小时费用<input style="width: 5rem" type="number" name=""> 30 + 每小时费用<input style="width: 5rem" type="number" name="cost" value="{$cost.cost}">
31 </td> 31 </td>
32 </tr> 32 </tr>
33 <tr> 33 <tr>
@@ -35,7 +35,7 @@ @@ -35,7 +35,7 @@
35 </tr> 35 </tr>
36 <tr> 36 <tr>
37 <td> 37 <td>
38 - 每天费用上限<input style="width: 5rem" type="number" name=""> 38 + 每天费用上限<input style="width: 5rem" type="number" name="ceiling" value="{$cost.ceiling}">
39 </td> 39 </td>
40 </tr> 40 </tr>
41 </table> 41 </table>
@@ -50,11 +50,11 @@ @@ -50,11 +50,11 @@
50 <tbody> 50 <tbody>
51 <tr> 51 <tr>
52 <th>开始时间</th> 52 <th>开始时间</th>
53 - <td><input class="form-control" type="time" name="start_time"></td> 53 + <td><input class="form-control" type="time" name="start_time" value="{$interval.start_time}"></td>
54 <th>结束时间</th> 54 <th>结束时间</th>
55 - <td><input class="form-control" type="time" name="end_time"></td> 55 + <td><input class="form-control" type="time" name="end_time" value="{$interval.end_time}"></td>
56 <th>每小时费用</th> 56 <th>每小时费用</th>
57 - <td><input class="form-control" type="number" name="price"></td> 57 + <td><input class="form-control" type="number" name="price" value="{$interval.price}"></td>
58 </tr> 58 </tr>
59 </tbody> 59 </tbody>
60 <tfoot> 60 <tfoot>
@@ -99,28 +99,6 @@ @@ -99,28 +99,6 @@
99 99
100 $('#more-template-select').val("{$post.more.template|default=''}"); 100 $('#more-template-select').val("{$post.more.template|default=''}");
101 }); 101 });
102 -  
103 - function doSelectCategory() {  
104 - var selectedCategoriesId = $('#js-categories-id-input').val();  
105 - openIframeLayer("{:url('AdminCategory/select')}?ids=" + selectedCategoriesId, '请选择分类', {  
106 - area: ['700px', '400px'],  
107 - btn: ['确定', '取消'],  
108 - yes: function (index, layero) {  
109 - //do something  
110 -  
111 - var iframeWin = window[layero.find('iframe')[0]['name']];  
112 - var selectedCategories = iframeWin.confirm();  
113 - if (selectedCategories.selectedCategoriesId.length == 0) {  
114 - layer.msg('请选择分类');  
115 - return;  
116 - }  
117 - $('#js-categories-id-input').val(selectedCategories.selectedCategoriesId.join(','));  
118 - $('#js-categories-name-input').val(selectedCategories.selectedCategoriesName.join(' '));  
119 - //console.log(layer.getFrameIndex(index));  
120 - layer.close(index); //如果设定了yes回调,需进行手工关闭  
121 - }  
122 - });  
123 - }  
124 </script> 102 </script>
125 </body> 103 </body>
126 </html> 104 </html>