$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' => dict::getDict('ptStyle', 'hd')]); } elseif ($isOpen == 2) { $open = \biz\wx\classes\WxOpenClass::getByCondition(['style' => dict::getDict('ptStyle', 'ghs')]); } elseif ($isOpen == 3) { $open = \biz\wx\classes\WxOpenClass::getByCondition(['style' => dict::getDict('ptStyle', 'mall')]); } else { util::fail('没有找到平台'); } $sjId = $open['sjId']; $merchant = xhMerchantService::getById($sjId); return $merchant; } }