<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Member\Util; use ModStart\Core\Dao\ModelUtil; class MemberFavoriteUtil { public static function urlFavorite($BEJrC, $I0Hpe, $Ix_Nr = '') { return modstart_api_url('member_favorite/favorite', array('category' => $BEJrC, 'categoryId' => $I0Hpe, 'redirect' => $Ix_Nr)); } public static function urlUnfavorite($BEJrC, $I0Hpe, $Ix_Nr = '') { return modstart_api_url('member_favorite/unfavorite', array('category' => $BEJrC, 'categoryId' => $I0Hpe, 'redirect' => $Ix_Nr)); } public static function add($mJcY3, $BEJrC, $I0Hpe) { $QjHVP = ModelUtil::get('member_favorite', array('userId' => $mJcY3, 'category' => $BEJrC, 'categoryId' => $I0Hpe)); if (empty($QjHVP)) { ModelUtil::insert('member_favorite', array('userId' => $mJcY3, 'category' => $BEJrC, 'categoryId' => $I0Hpe)); } } public static function delete($mJcY3, $BEJrC, $I0Hpe) { ModelUtil::delete('member_favorite', array('userId' => $mJcY3, 'category' => $BEJrC, 'categoryId' => $I0Hpe)); } public static function clean($BEJrC, $I0Hpe) { ModelUtil::delete('member_favorite', array('category' => $BEJrC, 'categoryId' => $I0Hpe)); } public static function exists($mJcY3, $BEJrC, $I0Hpe) { return ModelUtil::exists('member_favorite', array('userId' => $mJcY3, 'category' => $BEJrC, 'categoryId' => $I0Hpe)); } public static function paginate($mJcY3, $BEJrC, $iXUoW, $VUK_X, $r2pbP = array()) { goto Cf2rX; favTT: return ModelUtil::paginate('member_favorite', $iXUoW, $VUK_X, $r2pbP); goto h1ibX; hY1Wn: $r2pbP['where']['category'] = $BEJrC; goto favTT; Cf2rX: $r2pbP['where']['userId'] = $mJcY3; goto hY1Wn; h1ibX: } }