1. Yii2.0数据库查询实例(三)

    常用查询: // WHERE admin_id >= 10 LIMIT 0,10 User::find()->select('*')->where(['>=', 'admin_id', 10])->offset(0)->limit(10)->all() // SELECT `id`, (SELECT CO...

    2016-09-14

  2. Yii2.0数据库查询应用实例(二)

    findOne()和findAll(): // 查询key值为10的客户 $customer = Customer::findOne(10); $customer = Customer::find()->where(['id' => 10])->one(); // 查...

    2016-09-14

  3. Yii2.0数据库查询应用实例(一)

    原文地址 1.简单查询: [[one()]]: 根据查询结果返回查询的第一条记录。 [[all()]]: 根据查询结果返回所有记录。 [[count()]]: 返回记录的数量。 [[sum...

    2016-09-14

  4. Yii2设置全局变量

    common/config/param.php return [ .... 'frontsite_url' => 'http://local.yii2_myshop.com', ... ]; 调用 echo Yii::$app->params['frontsite_url'];

    2016-09-14

  5. YII2如何接收ajax过来的json/xml数据

    接收json或者xml数据 yii2用ajax以post方式传递json格式的数据,需要使用下面的插件 bobchengbin/yii2-xml-request-parser 下载插件 composer.json文件require部分添...

    2016-09-06

京ICP备16046576号-1