librelist archives

« back to archive

trueDelById 删除问题,删不掉

trueDelById 删除问题,删不掉

From:
free
Date:
2012-04-11 @ 10:14
  trueDelById = function (self, ids)
    	local idtype = type(ids)
print(idtype,ids);-->string 102
    	if idtype == 'table' then
    		for _, v in ipairs(ids) do
    			v = tostring(v)
		    	delFromRedis(self, v)
    			
    		end
		else
			delFromRedis(self, tostring(ids))			
    	end
    end;

Re: [bamboo] trueDelById 删除问题,删不掉

From:
Tang Daogang
Date:
2012-04-13 @ 11:01
问题已澄清。用delById的时候,前面要用对应的模型,而不是它的任何父模型。

2012/4/11 free <18602871035@163.com>

>  trueDelById = function (self, ids)
>        local idtype = type(ids)
> print(idtype,ids);-->string 102
>        if idtype == 'table' then
>                for _, v in ipairs(ids) do
>                        v = tostring(v)
>                        delFromRedis(self, v)
>
>                end
>                else
>                        delFromRedis(self, tostring(ids))
>        end
>    end;
>
>
>


-- 
Nothing is impossible.