...
|
...
|
@@ -38,6 +38,32 @@ class AdminCostController extends AdminBaseController{ |
|
|
|
|
|
public function editPost(){
|
|
|
$param=$this->request->param();
|
|
|
dump($param);
|
|
|
if (empty($param['free'])){
|
|
|
$param['free']=0;
|
|
|
}else{
|
|
|
$param['free']=1;
|
|
|
}
|
|
|
$cost=[
|
|
|
'free' => $param['free'],
|
|
|
'cost' => $param['cost'],
|
|
|
'ceiling' => $param['ceiling'],
|
|
|
'update_time' => time()
|
|
|
];
|
|
|
$interval=[
|
|
|
'start_time' => $param['start_time'],
|
|
|
'end_time' =>$param['end_time'],
|
|
|
'price' => $param['price'],
|
|
|
'update_time' => time()
|
|
|
];
|
|
|
try{
|
|
|
Db::startTrans();
|
|
|
Db::name('cost')->where('id',1)->update($cost);
|
|
|
Db::name('interval')->where('id',1)->update($interval);
|
|
|
}catch (\Exception $exception){
|
|
|
Db::rollback();
|
|
|
$this->error('保存失败');
|
|
|
}
|
|
|
Db::commit();
|
|
|
$this->success('保存成功');
|
|
|
}
|
|
|
} |
|
|
\ No newline at end of file |
...
|
...
|
|