php TP3.2添削改査まとめ

1924 ワード

1.  

2.削除
$ret = M("Message")->where($data)->delete();

3.変更
$data['status']= 1;
$map['id'] =11;
M()->where($map)->save($data);
4検査
4.1
$field = "count(1) AS count, t.client_id, m.user_id";
$map['m.status'] = array('eq', 1);
$map['t.client_id'] = array('in', $cids);
$rs = M("Message")->alias("m")->join("LEFT JOIN __TOKEN__ AS t ON m.user_id=t.uid")->field($field)->where($map)->group("t.client_id")->select();