$id]); return $merchant; } public static function updateById($id, $data) { xhWxOpen::updateById($id, $data); self::refresh($id); } public static function refresh($id) { self::getById($id); } public static function add($data) { $data = xhWxOpen::add($data); $id = $data['id']; self::refresh($id); return $data; } /** * 取平台相应的商家 */ public static function getMerchant($isOpen) { $open = []; if ($isOpen == 1) { $open = \biz\wx\classes\WxOpenClass::getByCondition(['style' => \biz\wx\classes\WxOpenClass::OPEN_STYLE_HD]); } elseif ($isOpen == 2) { $open = \biz\wx\classes\WxOpenClass::getByCondition(['style' => \biz\wx\classes\WxOpenClass::OPEN_STYLE_GHS]); } elseif ($isOpen == 3) { $open = \biz\wx\classes\WxOpenClass::getByCondition(['style' => \biz\wx\classes\WxOpenClass::OPEN_STYLE_MALL]); } else { util::fail('没有找到平台'); } $merchantId = $open['merchantId']; $merchant = xhMerchantService::getById($merchantId); return $merchant; } }