2021/1/7

thinkphp随机排序

->orderRaw("rand()")

  • thinkphp
  • 2021/1/7
  • 1,425
  • 2021/1/7

    thinkphp一对多关联查询排序/随机排序

    一对多关联 关联定义 一对多关联的情况也比较常见,使用hasMany方法定义,参数包括: hasMany('关联模型名','外键名','主键名',['模型别名定义']); 例如一篇文章可以有多个评论 …

  • fastadmin thinkphp
  • 2021/1/7
  • 1,982
  • 2020/11/25

    exec() has been disabled for security reasons

    打开php.ini,搜索disable_functions,代码如下: disable_functions = scandir,passthru,exec,system,chroot,chgrp,chown,shell_exec,proc_open,proc_get_status, ini_alter,ini_alter,ini_restore,dl,pfsockopen,…

  • fastadmin php thinkphp
  • 2020/11/25
  • 1,188
  • 2020/7/20

    thinkphp原生sql

    /所有查询必须  use/think/Db;        /* 1 配置数据库         * 2 使用DB 命名空间         *         */   &…

  • thinkphp
  • 2020/7/20
  • 839
  • 2020/7/13

    thinkphp全局变量

    在common.php中 define("wx_appid","123456"); 在其他文件直接 wx_appid就可以使用

  • thinkphp
  • 2020/7/13
  • 858
  • 2020/7/9

    tp5页面判断

    // 判断当 $data 为空时   {if condition="$data eq '' "}       无收藏 {else/}  有收藏内容 {/if}

  • thinkphp
  • 2020/7/9
  • 787
  • 2020/7/9

    tp​模板传参取参

    传参 return $this->fetch('hello',['name'=>'thinkphp']); 取参 Name:{$name}

  • thinkphp
  • 2020/7/9
  • 777