在写代码的时候会遇到一些要用原生语句的地方,下面记录一些原生语句写法
$Model = new \Think\Model(); // 实例化一个model对象 没有对应任何数据表
//添加
$balance = $Model->execute("insert into db_bid_yu_money(bid,pid,placeOrderId,addTime,how)values('$bid[bid]','$map[pid]','$poId',$map[poTime],'$how')");
//删除
$balance = $Model->query("delete db_user where uid = 1");
//修改
$balance = $Model->execute("update db_user set uName = '姐姐' where uid = 3");
//查询
$balance = $Model->query("select * from db_user where uid = 32");