会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
刀鞘里面没有刀
博客园
首页
新随笔
联系
订阅
管理
2024年5月11日
tp6 递归函数使用
摘要: public function findLastClass($id) { $classInfo = Db::name('class')->where('id', $id)->find(); if ($classInfo && $classInfo['islast'] == 1) { // 如果当前记
阅读全文
posted @ 2024-05-11 19:10 85541585
阅读(42)
评论(0)
推荐(0)
2024年2月11日
JS时间戳转时间
摘要: function formatDate(date) { var date = new Date(date); var YY = date.getFullYear() + '-'; var MM = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth()
阅读全文
posted @ 2024-02-11 17:53 85541585
阅读(28)
评论(0)
推荐(0)
JS日期格式化转换方法
摘要: Date.prototype.Format = function (fmt) { //author: meizz var o = { "M+": this.getMonth() + 1, //月份 "d+": this.getDate(), //日 "H+": this.getHours(), //
阅读全文
posted @ 2024-02-11 17:48 85541585
阅读(12)
评论(0)
推荐(0)
2023年3月5日
thinkphp 数据嵌套输出
摘要: thinkphp 数据嵌套输出 $list=Db::name('a')->field('id,xxx,...')->group('rwid')->select(); $data['list']=[]; foreach ( $list as $v){ $part=Db::name('a')->fiel
阅读全文
posted @ 2023-03-05 00:28 85541585
阅读(50)
评论(0)
推荐(0)
2023年2月17日
JS、PHP回车输入替换
摘要: PHP保存$data = preg_replace("/[\r\n]+/", '##', $a); //将回车键替换##保存JS 读取 var str1 = ldata.data.replace(/##/g,"\n"); //将数据##替换成回车显示
阅读全文
posted @ 2023-02-17 10:45 85541585
阅读(54)
评论(0)
推荐(0)
2021年9月9日
JS 访问函数内部变量的方法
摘要: 1. 使用 return 返回值进行获取函数内部变量 function test() { var testValue = 'innerValue'; return testValue;} console.log(test()); // 'innerValue'2. 通过闭包方式进行获取函数内部变量
阅读全文
posted @ 2021-09-09 16:37 85541585
阅读(967)
评论(0)
推荐(0)
2021年8月8日
tp6多循环结果重组
摘要: $group=Db::name('auth_group')->select();foreach ($group as $v){ $v['auth_group_access']=Db::name('auth_group_access')->where('group_id',$v['id'])->sel
阅读全文
posted @ 2021-08-08 08:33 85541585
阅读(55)
评论(0)
推荐(0)
2021年7月4日
js textarea换行分隔成数组和数组转换行符textarea回显
摘要: 换行、回车、空格分隔成数组 var arra2=a2.split(/[(\r\n)\r\n]+/);for(let i=0; i<arra2.length; i++){ if(arra2[i] ""){ arra2.remove(arra2[i]); }} 进行的识别分隔。其中\n代表换行,\r代表
阅读全文
posted @ 2021-07-04 21:05 85541585
阅读(614)
评论(0)
推荐(0)
2021年6月29日
Thinkphp6新增数据,并获取主键ID
摘要: // 方法1:insertGetId方法,新增数据并返回主键值使用getLastInsID Db::name('user')->insert($data); $userId = Db::name('user')->getLastInsID(); // 方法2:使用insertGetId方法 Db::
阅读全文
posted @ 2021-06-29 23:32 85541585
阅读(3357)
评论(0)
推荐(0)
2021年6月6日
sqlserver查询数据表中每个类别最新的一条记录
摘要: 查找某用户点击每个产品的最新的5条记录 SELECT max(id) AS maxid,pid FROM `u_b_history` where uid='1' GROUP BY `pid` ORDER BY `maxid` DESC LIMIT 5
阅读全文
posted @ 2021-06-06 22:06 85541585
阅读(606)
评论(0)
推荐(0)
下一页
公告