test_service d3170b4d1c 1
2023-12-01 15:43:29 +08:00

42 lines
970 B
PHP

<?php
namespace app\store\controller\food\order;
use app\store\controller\food\Controller;
use app\store\model\food\Pact as PactModel;
use app\store\model\food\Shop as ShopModel;
use think\facade\View;
/**
* 预约控制器
*/
class Pact extends Controller
{
/**
* 预约管理
*/
public function index($shop_id = 0)
{
if($this->shop_mode == 10){
$shop_id = $this->shop_id;
}
$model = new ShopModel;
$category = $model->getList(false);
$model = new PactModel;
$list = $model->getList($shop_id);
return View::fetch('index', compact('list','shop_id','category'));
}
/**
* 状态编辑
*/
public function status($id)
{
$model = PactModel::get($id);
$model->status['value']==10 ? $model->status = 20 : $model->status = 10;
$model->save();
return $this->renderSuccess('更新成功');
}
}