
php
wyljz
想着,做着,学着,活着
展开
-
vscode 做php开发环境配置
vscode 中安装插件: php server php debug php intellisense Code Runner Composer PHP DocBlocker在https://xdebug.org/download.php 下载xdebug,需与Php的版本对应 将下载的xdebug的dll文件放入php路径下的ext目录中系统环境变量path中加入php路径...原创 2018-08-27 11:22:47 · 24494 阅读 · 0 评论 -
jquery post 数组 到php
var chk = $('#tree').tree('getChecked',['checked','indeterminate']); var cs=[]; $.each(chk,function(i,v){ cs.push(v.id); }); var p={ roleId:$('#...原创 2018-10-18 08:57:57 · 1063 阅读 · 0 评论 -
tp5导入数据时的批量操作
先将要导入的数据整成一个数组,然后使用Db的insertAll来操作 Db::execute('SET FOREIGN_KEY_CHECKS = 0 '); $result = Db::table('t_modules')->insertAll($list,true); Db::execute('SET FOREIGN_KEY_CHECKS = 1 ');...原创 2018-10-18 23:07:00 · 3188 阅读 · 0 评论 -
php递归树的实现
使用到了https://github.com/akanehara/ginq,这个类库可以在php中像.net一样使用linqprivate function gettree(&$list, &$parent=null, &$tree=array()) { $query = Ginq::from($list)->where(function (...原创 2018-10-17 16:27:56 · 1003 阅读 · 0 评论 -
tp5 多对多关联操作
模型定义:模块:class Module extends Model{ protected $table = 't_modules'; protected $pk='id';}角色:class Role extends Model{ protected $table='t_roles'; protected $pk ='id'; publi...原创 2018-10-22 17:17:54 · 4235 阅读 · 2 评论