THINKPHP学习

  • $autoReply = D('AutoReply');
                $autoReply->select();
                 使用字符串查询
                $con = 'appid="'.$this->getAppID().""";
                 使用数值查询
    //          $constant=1
    //          $con = 'id='.$constant;
                查询
                //$result = $autoReply->where($con)->select();
                删除
                $result = $autoReply->where($con)->delete();
               插入
                $insert_data = $_GET["ret"];
                ThinkLog::record(__METHOD__." ".__LINE__." ".gettype($insert_data),'ERR');    
    PATHINFO模式
  • {$ruleItemData["keywords"][$i].keyword} 模板中使用变量
  • <if condition="$ruleItemData['keywords'][$i]['matchMode'] eq '0'">
  •  <for start="0" end ="$ruleItemData.keywordsCount" >
  • Smarty模板
  • vendor 供应方、插件
  • 模板中使用自定义函数: 应用目录下有Common目录,在此目录下的Common目录建立function.php
  • 无法加载控制器:home,
    •  'MODULE_ALLOW_LIST'  => array('Home','Admin'),
    • define('BIND_MODULE','WeChat');
      define('BUILD_CONTROLLER_LIST','Index,User,Menu');

       这些代码只在项目开始的时候使用,后面就不用了

should be compatible 的错误处理


打开 ThinkModelMongoModel.class.php 
找到 setInc($field,$step=1) 257行,修改为 setInc($field, $step = 1, $lazyTime = 0),
找到 setDec($field,$step=1) 268行,修改为 setDec($field, $step = 1, $lazyTime = 0) 。
打开 ThinkDbDriverMongo.class.php 
找到 connect($config='',$linkNum=0) 48行,修改为 connect($config = '', $linkNum = 0, $autoConnection = false),
找到 insertAll($dataList,$options=array()) 229行,修改为insertAll($dataList, $options = array(), $replace = false)。
原文地址:https://www.cnblogs.com/bornfish/p/5348058.html