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

cost

... ... @@ -11,6 +11,8 @@ namespace app\portal\controller;
use app\portal\model\EquipmentModel;
use cmf\controller\AdminBaseController;
use think\Db;
/**
* Class AdminCostController
* @package app\portal\controller
... ... @@ -27,9 +29,10 @@ use cmf\controller\AdminBaseController;
class AdminCostController extends AdminBaseController{
public function index(){
$Equipment=new EquipmentModel();
$data=$Equipment->paginate(10);
$this->assign('data',$data);
$cost=Db::name('cost')->where('id',1)->find();
$interval = Db::name('interval')->where('id',1)->find();
$this->assign('cost',$cost);
$this->assign('interval',$interval);
return $this->fetch();
}
}
\ No newline at end of file
... ...
... ... @@ -10,7 +10,7 @@
<ul class="nav nav-tabs">
<li class="active"><a>费用管理</a></li>
</ul>
<form action="{:url('AdminArticle/editPost')}" method="post" class="form-horizontal js-ajax-form margin-top-20">
<form action="{:url('AdminCost/editPost')}" method="post" class="form-horizontal js-ajax-form margin-top-20">
<div class="row">
<div class="col-md-3">
<table class="table table-bordered">
... ... @@ -19,7 +19,7 @@
</tr>
<tr>
<td>
<label><input type="checkbox" name="ty1" value="">第一小时免费</label><br/>
<label><input type="checkbox" name="free" value="" checked>第一小时免费</label><br/>
</td>
</tr>
<tr>
... ... @@ -27,7 +27,7 @@
</tr>
<tr>
<td>
每小时费用<input style="width: 5rem" type="number" name="">
每小时费用<input style="width: 5rem" type="number" name="cost" value="{$cost.cost}">
</td>
</tr>
<tr>
... ... @@ -35,7 +35,7 @@
</tr>
<tr>
<td>
每天费用上限<input style="width: 5rem" type="number" name="">
每天费用上限<input style="width: 5rem" type="number" name="ceiling" value="{$cost.ceiling}">
</td>
</tr>
</table>
... ... @@ -50,11 +50,11 @@
<tbody>
<tr>
<th>开始时间</th>
<td><input class="form-control" type="time" name="start_time"></td>
<td><input class="form-control" type="time" name="start_time" value="{$interval.start_time}"></td>
<th>结束时间</th>
<td><input class="form-control" type="time" name="end_time"></td>
<td><input class="form-control" type="time" name="end_time" value="{$interval.end_time}"></td>
<th>每小时费用</th>
<td><input class="form-control" type="number" name="price"></td>
<td><input class="form-control" type="number" name="price" value="{$interval.price}"></td>
</tr>
</tbody>
<tfoot>
... ... @@ -99,28 +99,6 @@
$('#more-template-select').val("{$post.more.template|default=''}");
});
function doSelectCategory() {
var selectedCategoriesId = $('#js-categories-id-input').val();
openIframeLayer("{:url('AdminCategory/select')}?ids=" + selectedCategoriesId, '请选择分类', {
area: ['700px', '400px'],
btn: ['确定', '取消'],
yes: function (index, layero) {
//do something
var iframeWin = window[layero.find('iframe')[0]['name']];
var selectedCategories = iframeWin.confirm();
if (selectedCategories.selectedCategoriesId.length == 0) {
layer.msg('请选择分类');
return;
}
$('#js-categories-id-input').val(selectedCategories.selectedCategoriesId.join(','));
$('#js-categories-name-input').val(selectedCategories.selectedCategoriesName.join(' '));
//console.log(layer.getFrameIndex(index));
layer.close(index); //如果设定了yes回调,需进行手工关闭
}
});
}
</script>
</body>
</html>
\ No newline at end of file
... ...