thinkphp5.1使用事务 //开启事务 Db::startTrans(); try{ //提交事务 Db::commit(); }catch(){ //回滚事务 Db::rollback(); }; Publish 18/10/09 / Views 2301 / 研究学习PHP
thinkphp5.0 隐藏入口文件 提示 No input file specified. 以下是官方提供的方法1、httpd.conf配置文件中加载了mod_rewrite.so模块2、AllowOverride None 将None改为 All3、在应用入口文件同级目录添加.htaccess文件,内容如下:<IfModule mod_rewrite.c>Options +FollowSymlinks -MultiviewsRewriteEngine onRewrit... Publish 18/09/05 / Views 2750 / 研究学习
thinkphp5.1模型关联查询[使用被关联表的字段作为条件] thinkphp5.1 模型关联查询使用被关联表的字段作为条件以下查询为查询某商户的订单,以商品所属商铺id为条件查询订单。$order为订单模型$result = $order::hasWhere("Goods",["uid" => $uid]) ->where("status",&qu... Publish 18/08/21 / Views 2579 / 笔记
thinkphp5.1关联模型条件查询 在模型内使用一对一或者一对多关联并对被关联模型进行条件查询public function getcover(){ return $this->hasMany("Comments","cid","id")->where("status", "=", "1&q... Publish 18/08/15 / Views 2885 / 研究学习PHP