发现冲突

main
yangsai 3 weeks ago
parent 12d10a6d5a
commit bd11fa040a
  1. 3
      app/controller/cashier/Table.php
  2. 25
      app/controller/cashier/User.php

@ -51,6 +51,7 @@ class Table extends AuthController
if(!empty($yuyue)){
$v2['yingxiaojingli'] = db::name('user')->where('uid', $yuyue['admin_id'])->value('nickname') ?? '无';
$v2['yuyueshijian'] = $yuyue['yuding_date'] . ' ' . $yuyue['come_date'];
$v2['phone'] = $yuyue['phone'];
}
}
@ -257,7 +258,7 @@ class Table extends AuthController
$partakeService->del(['collate_code_id' => $tableId]);
/** @var TableQrcodeServices $qrcodeService */
$qrcodeService = app()->make(TableQrcodeServices::class);
$qrcodeService->update($qrcodeId, ['is_use' => 0, 'eat_number' => 0, 'order_time' => 0]);
$qrcodeService->update($qrcodeId, ['is_use' => 0, 'eat_number' => 0, 'order_time' => 0,'kaibao'=>0]);
if ($oid) {
/** @var StoreOrderServices $orderService */
$orderService = app()->make(StoreOrderServices::class);

@ -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('操作失败');
}

Loading…
Cancel
Save