查询
$model->where( 'next_time' , [ '=' , 0 ] , [ '>' , time() ] , 'or' )->where( [ 'name' => [ 'like' , '%' . $search_name . '%' ] ] )->OrderRaw(" shop_id = 2 desc ")
更新
db('表名')->where()->update(['什么'=>'变成什么'])
更新表,使字段自增长+100
db('member')->where(['member_id'=>11111])->setInc('gebi', 100);
更新表获取表的自增id
$res = $goods_model->allowField(true)->insertGetId($goods)
auth:fpc