<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\CmsHelp\Core; use ModStart\Core\Dao\ModelUtil; use ModStart\Core\Util\HtmlUtil; use Module\Vendor\Provider\SuperSearch\AbstractSuperSearchBiz; use Module\Vendor\Provider\SuperSearch\AbstractSuperSearchProvider; use Module\Vendor\Provider\SuperSearch\FieldTypes; use Module\Vendor\Provider\SuperSearch\SuperSearchProvider; class CmsHelpSuperSearchBiz extends AbstractSuperSearchBiz { const NAME = 'cms_help'; public function name() { return self::NAME; } public function title() { return '帮助中心'; } public function fields() { return array('id' => array('type' => FieldTypes::F_LONG), 'categoryId' => array('type' => FieldTypes::F_LONG), 'title' => array('type' => FieldTypes::F_TEXT), 'content' => array('type' => FieldTypes::F_TEXT)); } public function syncBatch(AbstractSuperSearchProvider $yzKqK, $jMLrS) { goto RBzlO; KDXcf: self::syncUpsert($om_hh['records'], false); goto sjtdv; Ju68k: $MGhSY['nextId'] = $om_hh['nextId']; goto sg6kd; sg6kd: return $MGhSY; goto nBEH1; BTrdt: $MGhSY['count'] = count($om_hh['records']); goto Ju68k; RBzlO: $om_hh = ModelUtil::batch('cms_help', $jMLrS, 1000); goto KDXcf; sjtdv: $MGhSY = array(); goto BTrdt; nBEH1: } public static function provider() { return SuperSearchProvider::get(modstart_config('CmsHelp_SuperSearchProvider')); } public static function syncDelete($MkmbZ) { goto JZeaj; L6ar8: if (empty($yzKqK)) { return; } goto fo4ZQ; fo4ZQ: $yzKqK->delete('cms_help', $MkmbZ); goto l2OYy; JZeaj: $yzKqK = self::provider(); goto L6ar8; l2OYy: } public static function syncUpsert($ZzHwD, $YMMP6 = true) { goto bitMs; bitMs: $yzKqK = self::provider(); goto Dlafl; tpnP8: foreach ($ZzHwD as $gvTPQ) { $yzKqK->upsert('cms_help', $gvTPQ['id'], array('id' => intval($gvTPQ['id']), 'categoryId' => intval($gvTPQ['categoryId']), 'title' => $gvTPQ['title'], 'content' => HtmlUtil::html2text($gvTPQ['content']))); } goto nw7uB; MkBpY: if ($YMMP6) { $yzKqK->ensureBucket('cms_help'); } goto tpnP8; Dlafl: if (empty($yzKqK)) { return; } goto MkBpY; nw7uB: } }