|
|
@ -51,16 +51,15 @@ class Merchant extends BaseModel |
|
|
|
* @param int $storeId |
|
|
|
* @param int $storeId |
|
|
|
* @return static|array|null |
|
|
|
* @return static|array|null |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public static function getMerchantId(int $merchantId) |
|
|
|
public static function getMerchantId(String $userName) |
|
|
|
{ |
|
|
|
{ |
|
|
|
try { |
|
|
|
try { |
|
|
|
$list = self::withoutGlobalScope() |
|
|
|
$info = self::withoutGlobalScope() |
|
|
|
->with(['logoImage', "licenseImage"]) |
|
|
|
->where('user_name', '=', $userName) |
|
|
|
->where('merchant_id', '=', $merchantId) |
|
|
|
|
|
|
|
->find(); |
|
|
|
->find(); |
|
|
|
return $list ?? null; |
|
|
|
return $info['merchant_id'] ?? 0; |
|
|
|
} catch (\Exception $e) { |
|
|
|
} catch (\Exception $e) { |
|
|
|
return null; |
|
|
|
return 0; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|