|
|
|
@ -295,7 +295,7 @@ class User extends AuthController |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//台桌预定 |
|
|
|
|
public function tableYuDing($wtable_id, $wremark, $wphone, $wyuding_date,$come_date,$store_id) |
|
|
|
|
public function tableYuDing($wtable_id, $wremark, $wphone, $wyuding_date,$come_date,$store_id,$admin_id) |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
$post['table_id'] = $wtable_id; |
|
|
|
@ -304,6 +304,7 @@ class User extends AuthController |
|
|
|
|
$post['come_date'] = $come_date; |
|
|
|
|
$post['remark'] = $wremark; |
|
|
|
|
$post['store_id'] = $store_id; |
|
|
|
|
$post['admin_id'] = $admin_id; |
|
|
|
|
$post['create'] = time(); |
|
|
|
|
|
|
|
|
|
//校验这个桌子有无在使用 |
|
|
|
@ -336,10 +337,11 @@ class User extends AuthController |
|
|
|
|
*/ |
|
|
|
|
public function swithUser(Request $request) |
|
|
|
|
{ |
|
|
|
|
//wmc api |
|
|
|
|
//wmc api1 |
|
|
|
|
//预定 |
|
|
|
|
$wtable_id = $request->post('wtable_id', 0); |
|
|
|
|
if (!empty($wtable_id)) { |
|
|
|
|
$kaibao = $request->post('kaibao', 0); |
|
|
|
|
if (!empty($wtable_id&&empty($kaibao))) { |
|
|
|
|
|
|
|
|
|
$ttttt = Db::name('table_qrcode')->where('id',$wtable_id)->where('is_use',0)->find(); |
|
|
|
|
if(!$ttttt){ |
|
|
|
@ -351,18 +353,29 @@ class User extends AuthController |
|
|
|
|
$wyuding_date = $request->post('wyuding_date', 0); |
|
|
|
|
$come_date = $request->post('come_date', 0); |
|
|
|
|
$store_id = $request->post('store_id', 1); |
|
|
|
|
$admin_id = $request->post('admin_id', 0); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (empty($wremark) || empty($wphone) || empty($wyuding_date) || empty($come_date)) { |
|
|
|
|
if (empty($wyuding_date) || empty($come_date)) { |
|
|
|
|
return $this->fail('请填写完整参数'); |
|
|
|
|
} else { |
|
|
|
|
$res = $this->tableYuDing($wtable_id, $wremark, $wphone, $wyuding_date,$come_date,$store_id); |
|
|
|
|
$res = $this->tableYuDing($wtable_id, $wremark, $wphone, $wyuding_date,$come_date,$store_id,$admin_id); |
|
|
|
|
if ($res) { |
|
|
|
|
return $this->success('预定成功'); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return $this->fail('预定失败'); |
|
|
|
|
}else if($kaibao){ |
|
|
|
|
if($kaibao==1){ |
|
|
|
|
if(Db::name('table_qrcode')->update(['id' => $wtable_id, 'kaibao' => 1,'is_use'=>2])){ |
|
|
|
|
return $this->success('开台成功'); |
|
|
|
|
} |
|
|
|
|
}else if($kaibao==2){ |
|
|
|
|
if(Db::name('table_qrcode')->update(['id' => $wtable_id, 'kaibao' => 0,'is_use'=>0])){ |
|
|
|
|
return $this->success('清台成功'); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return $this->fail('操作失败'); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|