国产+高潮+在线,国产 av 仑乱内谢,www国产亚洲精品久久,51国产偷自视频区视频,成人午夜精品网站在线观看

GatewayWorker Db類可以實(shí)現(xiàn)字段加1操作么?

huxiaohaiyang
$db = Db::instance('development');
$db->update('mailList')->cols(array('status'=>1,'times'=>'times'+1))->where('id='.$id)->query();
Workerman中這樣寫報錯

zend 中可以這樣寫:
$db = Zend_Db_Table::getDefaultAdapter();
$where = $db->qutoInto('id = ?',$id);
$db->update('mailList',array('status'=>1,'times'=>new Zend_Db_Expr('times+'.1)),$where)

還是只能取的時候多取一個字段加
$db->update('mailList')->cols(array('status'=>1,'times'=>$times+1))->where('id='.$id)->query();

update mailList set status=1, times = times+1 where id =1;
3235 3 0
3個回答

huxiaohaiyang

不支持MarkDown,不知道代碼怎么貼了

  • 暫無評論
walkor 打賞

直接寫sql吧,那個DB類支持直接寫sql的

walkor 打賞

或者試下
$db->update('mailList')->cols(array('status'=>1,'times'=>'times+1'))->where('id='.$id)->query();

年代過于久遠(yuǎn),無法發(fā)表回答
??