Store.php 566 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. namespace addons\YunfastPay\common\models;
  3. use addons\Store\common\models\Store as ModelsStore;
  4. /**
  5. * Store class
  6. * @package addons\YunfastPay\common\models
  7. */
  8. class Store extends ModelsStore
  9. {
  10. /**
  11. * 获取店铺名称
  12. *
  13. * @param integer $storeId
  14. * @return string
  15. */
  16. public static function getStoreNameById(int $storeId)
  17. {
  18. if ($storeId == 0) return '平台';
  19. return static::find()
  20. ->select('store_name')
  21. ->where(['id' => $storeId])
  22. ->scalar();
  23. }
  24. }