| xqd
@@ -77,7 +77,13 @@ class TableController extends CommonController
|
|
|
$data['bzc_area'] = 0;
|
|
|
}
|
|
|
if($data['house_type'] == null){
|
|
|
- $data['house_type'] = '默认:住房';
|
|
|
+ $data['house_type'] = '未填';
|
|
|
+ }
|
|
|
+ if($data['bzc_cardid'] == null){
|
|
|
+ $data['house_type'] = '未填';
|
|
|
+ }
|
|
|
+ if($data['table_time'] == null){
|
|
|
+ $data['table_time'] = date('y-m-d h:i:s',time());
|
|
|
}
|
|
|
$data['status'] = '0';
|
|
|
$data['user_id'] = $user->id;
|
| xqd
@@ -88,7 +94,7 @@ class TableController extends CommonController
|
|
|
if($re){
|
|
|
return redirect('/on_table');
|
|
|
}else{
|
|
|
- return back()->with('errors','保存失败请重试!');
|
|
|
+ return back()->withErrors('errors','保存失败请重试!');
|
|
|
}
|
|
|
|
|
|
// 把数据转化为json
|
| xqd
@@ -127,7 +133,7 @@ class TableController extends CommonController
|
|
|
public function submit(Request $request,$table_id)
|
|
|
{
|
|
|
$user = session('user');
|
|
|
- $input = $request->only('project_name','bzc_name','bzc_cardid','bzc_addr','bzc_area','house_type','bzc_tel','used','num','table_time,description');
|
|
|
+ $input = $request->only('project_name','bzc_name','bzc_cardid','bzc_addr','bzc_area','house_type','bzc_tel','used','num','table_time','sub_description');
|
|
|
$data = $input;
|
|
|
|
|
|
$data['user_id'] = $user->id;
|
| xqd
@@ -185,6 +191,19 @@ class TableController extends CommonController
|
|
|
public function edit($table_id)
|
|
|
{
|
|
|
$table = Tablelist::find($table_id);
|
|
|
+ $temp = [
|
|
|
+ 'project_name' => $table->project_name,
|
|
|
+ 'bzc_name' => $table->bzc_name,
|
|
|
+ 'bzc_cardid' => $table->bzc_cardid,
|
|
|
+ 'bzc_addr' => $table->bzc_addr,
|
|
|
+ 'bzc_area' => $table->bzc_area,
|
|
|
+ 'house_type' => $table->house_type,
|
|
|
+ 'bzc_tel' => $table->bzc_tel,
|
|
|
+ 'used' => $table->used,
|
|
|
+ 'num' => $table->num,
|
|
|
+ 'table_time' => $table->table_time,
|
|
|
+ 'sub_description' => $table->sub_description
|
|
|
+ ];
|
|
|
$table_type_id = $table['table_id'];
|
|
|
$json = json_decode($table['json'],true);
|
|
|
$table = json_encode($table);
|
| xqd
@@ -192,6 +211,17 @@ class TableController extends CommonController
|
|
|
$table = array_merge($table,$json);
|
|
|
$user = session('user');
|
|
|
$table['judge']=$user->role;
|
|
|
+ $table['project_name'] = $temp['project_name'];
|
|
|
+ $table['bzc_name'] = $temp['bzc_name'];
|
|
|
+ $table['bzc_cardid'] = $temp['bzc_cardid'];
|
|
|
+ $table['bzc_addr'] = $temp['bzc_addr'];
|
|
|
+ $table['bzc_area'] = $temp['bzc_area'];
|
|
|
+ $table['house_type'] = $temp['house_type'];
|
|
|
+ $table['bzc_tel'] = $temp['bzc_tel'];
|
|
|
+ $table['used'] = $temp['used'];
|
|
|
+ $table['num'] = $temp['num'];
|
|
|
+ $table['table_time'] = $temp['table_time'];
|
|
|
+ $table['sub_description'] = $temp['sub_description'];
|
|
|
$table = (object)$table;
|
|
|
|
|
|
if($table_type_id == 1){
|