public function doIsHot($map, $act)
{
if (empty($map)) {
throw new ThinkException('不允许空条件操作数据库');
}
$optsIds = $this->where($map)->getField('optsId');
$map_opts['id'] = array('in', $optsIds);
switch ($act) {
case 'recommend':
//推荐
$data['isHot'] = 1;
$data['rTime'] = time();
$result = self::factoryModel('opts')->where($map_opts)->save($data);
break;
case 'cancel':
//取消推荐
$data['isHot'] = 0;
$data['rTime'] = 0;
$result = self::factoryModel('opts')->where($map_opts)->save($data);
break;
}
return $result;
}