$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');