qeephp如何批量更新和删除记录?

<?php

/**
 * updateWhere 处理关联表,更安全,但是效率相对较低
 */
Project::meta()->updateWhere(array('click'=>9),'[pid] =?',2);
/**
 * updateDbWhere 第二个参数为sql条件字符窜,或者条件数组,不支持动态参数模式
 */
Project::meta()->updateDbWhere(array('click'=>8),array('pid'=>'abc'));
/**
 * destory 会检查实例化所有的对象 处理好表关联等后销毁
 */
Project::meta()->destroyWhere('[pid] =? and [click] = ?','abc',20);
/**
 * detele 也不支持动态参数模式
 */
Project::meta()->deleteWhere(array('pid'=>'abc'));

posted @ 2017-03-29 10:34  过眼云烟丶而已  阅读(207)  评论(0)    收藏  举报