平时使用sql的时候可以如下添加默认字段flag:

"select a.*,0 as flag from user_info a",

 

对于yii2框架则需要这样:

$query =(new \yii\db\Query())
        ->select([
   'r.real_name',
          new Expression("'身份证' id_no_type")
  ])
->from(['r' => $this->tableName()])

相关文章:

  • 2021-11-05
  • 2022-12-23
  • 2021-10-18
  • 2021-07-29
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-10-23
  • 2021-08-20
  • 2022-12-23
  • 2022-12-23
  • 2021-08-14
  • 2022-12-23
  • 2021-08-30
相关资源
相似解决方案