| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- <?php
- namespace App\Servers;
- use App\Models\Main\MainShop;
- use App\Models\TableNumber;
- use Illuminate\Support\Facades\DB;
- /**
- * 商家管理
- */
- class ShopServer
- {
- static private $server = null;
- private function __construct()
- {
- }
- /**
- * 创建对象
- * @return ShopServer
- */
- static function creatServer()
- {
- if (empty(self::$server)) self::$server = new ShopServer();
- return self::$server;
- }
- /**
- * 获取店铺详情
- * @param $shop_id
- * @return MainShop|\Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Eloquent\Model|\Illuminate\Database\Query\Builder|object|null
- */
- function getShopInfo($shop_id){
- //$status 1正常 2闭店
- return MainShop::where('id',$shop_id)->select(['id','shop_name','status','shop_logo','shop_phone','address','city_name'])->first();
- }
- /**
- * 获取桌号信息
- * @param $shop_id
- * @param $number
- * @return TableNumber|\Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Eloquent\Model|\Illuminate\Database\Query\Builder|object|null
- */
- function getTableInfo($shop_id,$number){
- //$status 1正常 2闭店
- return TableNumber::where('shop_id',$shop_id)->where('number',$number)->select(['id','number','title','status'])->first();
- }
- }
|