|
|
@@ -2,6 +2,7 @@
|
|
|
|
|
|
namespace biz\merchant\classes;
|
|
|
|
|
|
+use common\components\business;
|
|
|
use Yii;
|
|
|
use biz\base\classes\BaseClass;
|
|
|
|
|
|
@@ -16,7 +17,7 @@ class MerchantClass extends BaseClass
|
|
|
2 => ['id' => 2, 'url' => '/mall/index?account=12358', 'img' => 'http://a.huahb.com/images/avatar.jpg', 'sign' => 'mall', 'name' => '申请会员'],
|
|
|
3 => ['id' => 3, 'url' => '/mall/index?account=12358', 'img' => 'http://a.huahb.com/images/avatar.jpg', 'sign' => 'mall', 'name' => '点我付款'],
|
|
|
];
|
|
|
-
|
|
|
+
|
|
|
//商家信息组合 shish 2019.12.20
|
|
|
public static function groupMerchantBaseInfo($list)
|
|
|
{
|
|
|
@@ -27,5 +28,23 @@ class MerchantClass extends BaseClass
|
|
|
{
|
|
|
return self::getAllByCondition(['id' => ['in', $ids]], null, '*', 'id');
|
|
|
}
|
|
|
+
|
|
|
+ public static function getMerchantById($id)
|
|
|
+ {
|
|
|
+ $merchant = self::getById($id);
|
|
|
+ if (empty($merchant)) {
|
|
|
+ return $merchant;
|
|
|
+ }
|
|
|
+ $list = self::groupBaseInfo([$merchant]);
|
|
|
+ return current($list);
|
|
|
+ }
|
|
|
+
|
|
|
+ public static function groupBaseInfo($list)
|
|
|
+ {
|
|
|
+ foreach ($list as $key => $val) {
|
|
|
+ $list[$key] = business::formatMerchantLogo($list[$key]);
|
|
|
+ }
|
|
|
+ return $list;
|
|
|
+ }
|
|
|
|
|
|
}
|