ShopServer.php 857 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. namespace App\Servers;
  3. use App\Models\Main\MainShop;
  4. use Illuminate\Support\Facades\DB;
  5. /**
  6. * 商家管理
  7. */
  8. class ShopServer
  9. {
  10. static private $server = null;
  11. private function __construct()
  12. {
  13. }
  14. /**
  15. * 创建对象
  16. * @return ShopServer
  17. */
  18. static function creatServer()
  19. {
  20. if (empty(self::$server)) self::$server = new ShopServer();
  21. return self::$server;
  22. }
  23. /**
  24. * 获取店铺详情
  25. * @param $shop_id
  26. * @return MainShop|\Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Eloquent\Model|\Illuminate\Database\Query\Builder|object|null
  27. */
  28. function getShopInfo($shop_id){
  29. //$status 1正常 2闭店
  30. return MainShop::where('id',$shop_id)->select(['id','shop_name','status','shop_logo','shop_phone','address'])->first();
  31. }
  32. }