db->selectRow($sql); return $_row; } public function getChannelByType($channelType) { $filter = ['channel_type' => $channelType]; $channel = $this->dump($filter); if(!$channel){ return false; } return $channel; } /** * 发票接口绑定调度 * @param $data * @param $response * @return array|bool|int|void */ public function bindChannelCallback($channel,$result) { if(!isset($channel['channel_id']) || !$channel['channel_id']){ return [false,"渠道主键不存在"]; } $response = $result['data']; if(!isset($response['info'], $response['info']['node_id']) || !$response['info']['node_id']){ return [false, "绑定节点号不存在"]; } $updateData = [ 'node_id' => $response['info']['node_id'], 'node_type' => $response['info']['node_type'], ]; $filter = [ 'channel_id' => $channel['channel_id'] ]; $updateRs = $this->update($updateData, $filter); if($updateRs === false){ return [false, "更新节点号失败"]; } return [true, "绑定成功"]; } }