dmodai

dmodai

信与持

  • 财富值560
  • 威望值40
  • 总积分1050

个人信息

  • 首页就报错

    Notice: Trying to get property of non-object in D:\phpStudy\WWW\SELF\yii\yiisns2\frontend\config\main.php on line 17
    
    Notice: Trying to get property of non-object in D:\phpStudy\WWW\SELF\yii\yiisns2\frontend\config\main.php on line 17
    

    对应的是

      'aliases' => [
            '@views' => dirname(__DIR__) . "/views/",
            '@jsUrl' => Yii::$app->request->baseUrl."/js/"
        ],
    

    请问怎么解决啊

  • 回复了 的回答

    还是预处理的更好用

    Chat::find()->where('id > :id and uid = :uid', [':id'=>118, 'uid'=> 1])->asArray()->all();
    

    如果先看到底运行的原生sql是什么可以用这样

    $query = Post::find()->where('author_id = :author_id and status = :status', [':author_id'=>2, ':status'=> 2]);
          $commandQuery = clone $query;
          echo $commandQuery->createCommand()->getRawSql();
    
          print_r($query->all());
    

    $query = Post::find()->select('max(id) as max_id ')->where('author_id = :author_id and status = :status', [':author_id'=>1, ':status'=> 2]);
    

    看文档的查询构建器

  • 2016-05-13 已签到
    连续签到9天,获得了20个金钱
  • 还是预处理的更好用

    Chat::find()->where('id > :id and uid = :uid', [':id'=>118, 'uid'=> 1])->asArray()->all();
    

    如果先看到底运行的原生sql是什么可以用这样

    $query = Post::find()->where('author_id = :author_id and status = :status', [':author_id'=>2, ':status'=> 2]);
          $commandQuery = clone $query;
          echo $commandQuery->createCommand()->getRawSql();
    
          print_r($query->all());
    
  • 2016-05-12 已签到
    连续签到8天,获得了20个金钱
  • 2016-05-11 已签到
    连续签到7天,获得了20个金钱
  • 赞了源码
    登陆流程(一)
  • 2016-05-10 已签到
    连续签到6天,获得了20个金钱
  • 请问您在github上有可学习的源码吗

经理 等级规则
1050/2000
资料完整度
40/100
用户活跃度
0/100

Ta的关注

1

Ta的粉丝

4

Ta的访客

11