<?php


namespace App\Services\common;

use App\Models\goods\mysql\GoodsSkuSubShop;
use App\Models\shop\mysql\Shop;
use App\Models\shop\mysql\SubShop;
use Api\PhpUtils\Validate\Validate;
use Api\PhpServices\Idgen\Idgen;

// use Validate\ShopValidate;
use App\Exception\custom\ShopException;
use Api\PhpServices\Sensitive\Sensitive;
use App\Exception\custom\InterfaceException;
use Api\PhpUtils\Http\Request;

class CommonService
{

   
    /**
     * 通过生活号id获取生活号信息
     * life_account_id = [] 数组形式传递
     *
     */
    public static function getlifeAccountList($params)
    {
        $lifeAccountId = !empty($params['life_account_id']) ? $params['life_account_id'] : '';
        $url = config('interface', 'merchant.lifeaccount.get_life_account_by_ids');
        if (empty($url)) {
            throw new InterfaceException(['cus' => 1]);
        }
        if (empty( $lifeAccountId )) {
           return [];
        }
        $params['life_account_ids'] = implode(',', $lifeAccountId);
        $res = (new Request())->get($url, $params);
        if ($res['code'] == 0 && isset($res['response'])) {  
            return $res['response']['result'];
        }
        return [];
    }

}