yii2中的sql调试,可打印出sql来:

  1. User::find()->where("isgive=0 and intime > $t")->limit(100)->orderby("id desc")->createCommand()->getRawSql(); die;
  2. self::find()->asArray()
  3. ->where(['member_id' => $memberIds])
  4. ->select(['member_id', 'order_id', 'count(*) as orderCount'])
  5. ->indexBy('member_id')
  6. ->groupBy('order_id')
  7. //->createCommand()->getRawSql();
  8. ->all();

分类: web

标签:   php   yii2