tp3.2查询指定的字段


$categoods1 = M()->db(2,'a')->table('yp_goods')->field( 'goods_thumb,goods_video')->where($map)->select();
查询goods_thumb,goods_video  用到了field

 

and查询
$User = M("User"); // 实例化User对象
$map['status'] = 1;
$map['title']  = 'thinkphp';
// 把查询条件传入查询方法
$User->where($map)->select(); 
'_multi'=>true必须加在数组的最后,表示当前是多条件匹配,这样查询条件就变成 status= 1 AND title = 'thinkphp'

 

        $map['user_id'] =$user_id;
        $map['type'] ='22';
        $map['date'] =array('between',array($start,$end));
       
        $daymoney = M('Log')->where($map)->sum('amount');
        

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM