<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace Module\Member\Util; use ModStart\Core\Dao\ModelUtil; class MemberFavoriteUtil { public static function urlFavorite($midJh, $Rfywh, $j1j5n = '') { return modstart_api_url('member_favorite/favorite', array('category' => $midJh, 'categoryId' => $Rfywh, 'redirect' => $j1j5n)); } public static function urlUnfavorite($midJh, $Rfywh, $j1j5n = '') { return modstart_api_url('member_favorite/unfavorite', array('category' => $midJh, 'categoryId' => $Rfywh, 'redirect' => $j1j5n)); } public static function add($klMu7, $midJh, $Rfywh) { $nnCtx = ModelUtil::get('member_favorite', array('userId' => $klMu7, 'category' => $midJh, 'categoryId' => $Rfywh)); if (empty($nnCtx)) { ModelUtil::insert('member_favorite', array('userId' => $klMu7, 'category' => $midJh, 'categoryId' => $Rfywh)); } } public static function delete($klMu7, $midJh, $Rfywh) { ModelUtil::delete('member_favorite', array('userId' => $klMu7, 'category' => $midJh, 'categoryId' => $Rfywh)); } public static function clean($midJh, $Rfywh) { ModelUtil::delete('member_favorite', array('category' => $midJh, 'categoryId' => $Rfywh)); } public static function exists($klMu7, $midJh, $Rfywh) { return ModelUtil::exists('member_favorite', array('userId' => $klMu7, 'category' => $midJh, 'categoryId' => $Rfywh)); } public static function paginate($klMu7, $midJh, $j13Tr, $OB9LF, $AQ4wg = array()) { goto vJJgQ; E7zFc: $AQ4wg['where']['category'] = $midJh; goto zaX4f; zaX4f: return ModelUtil::paginate('member_favorite', $j13Tr, $OB9LF, $AQ4wg); goto VK4YF; vJJgQ: $AQ4wg['where']['userId'] = $klMu7; goto E7zFc; VK4YF: } }