摘要:原因crontab默认的 path 设置和系统自身的有区别git 命令放在 /usr/local/bin/ 目录 whereis git而crontab 却在 /sbin:/bin:/usr/sbin:/usr/bin解决办法以下是crontab实例git pull 修改成 /usr/local/bin/git pull#礼拜一到礼拜六的8-22点每分钟更新 update_web....
阅读全文
摘要:field( $model, 'unit_id', [ 'inputOptions' => [ 'class' => 'required', ...
阅读全文
摘要:where() public methodSets the WHERE part of the query.The method requires a $condition parameter, and optionally a $params parameter specifying the values to be bound to the query.The $condition param...
阅读全文
摘要:$query=$sql->where([ 'test_id'=>24, 'name'=>'小洋' ]);//打印sql;$query->prepare(Yii::$app->db->queryBuilder)->createCommand...
阅读全文
摘要:$sql_tmp= "UPDATE `eabc_order_detail` set send_number=num where order_sn='".$model_order->order_sn."'";Yii::$app->db->createCommand($sql_tmp)->execute();来自为知笔记(Wiz)
阅读全文
摘要:$loginForm = new UserForm(['scenario' => 'login2']); $loginForm->load(Yii::$app->request->post()); $loginForm->validate(); $loginForm->log...
阅读全文
摘要:yii2 框架定义的约束 public $builtInValidators = [ 'boolean' => 'yii\validators\BooleanValidator', 'captcha' => 'yii\captcha\CaptchaValidator', 'compare' => 'yii\validators\CompareVa...
阅读全文
摘要:$insertNum=\Yii::$app->db->createCommand()->batchInsert('{{%join_relation}}',['real_name','status','seller_muser_id','buyer_muser_id','opera_time'],$arrJoin)->execute(); if($insertNum!=...
阅读全文
摘要:解决Yii2中刷新网页时验证码不刷新的问题 [ 2.0 版本 ] ljfrocky 2015-05-30 19:39:00 1304次浏览 5条评论 10 11 0在Yii2框架中,如果在表单中使用了验证码,会发现一个奇怪的小问题,就是刷新网页时验证码图片不会跟着刷新。网上的解决方法网上的大多数解决方法都是通过修改vendor/yiisoft/yii2/captcha/CaptchaAct...
阅读全文
摘要:Yii2,layout中使用Controller的值,Controller向layout传值的两种方式。yii2中在通过Controller向layout中传值,layout中访问Controller中的值,1、第一种,通过layout变量数组赋值12$view = Yii::$app->view;$view->params['layout_data'] = '传给layout的值';2、第二种,...
阅读全文
摘要:/** * Explain:取得买家名称 */ public function getBuyerName(){ return $this->hasOne(UserModel::className(),['user_id'=>'buyer_id'])->from(UserModel::tableName().' u1'); }来自为知笔记(Wiz)
阅读全文
摘要:publicfunction behaviors(){return['verbs'=>['class'=>VerbFilter::className(),'actions'=>['delete'=>['post'],],],];}来自为知笔记(Wiz)
阅读全文
摘要:arrayArray.prototype.clone=function(){ return this.slice(0); }对象var o = {a: [1]}; //浅拷贝 var o1 = $.extend({}, o); console.log(o1.a === o.a); // true //深拷贝 var o2 = $.extend(true, {}, o); console.lo...
阅读全文
摘要:var str="我爱中国";if(str.indexOf("中国")>=0){ alert("含有此字符串");}else{ alert("没有此字符串");} 来自为知笔记(Wiz)
阅读全文
摘要:indexOf()定义和用法indexOf() 方法可返回某个指定的字符串值在字符串中首次出现的位置。语法stringObject.indexOf(searchvalue,fromindex)参数描述searchvalue 必需。规定需检索的字符串值。fromindex 可选的整数参数。规定在字符串中开始检索的位置。它的合法取值是 0 到 stringObject.length - 1...
阅读全文
摘要:function _getIds(selectedIds, targetType){ var ids = ""; var $box = targetType == "dialog" ? $.pdialog.getCurrent() : navTab.getCurrentPanel(); $box.find("input:checked...
阅读全文
摘要:window.event.returnValue=false;在location.href后加上后修复来自为知笔记(Wiz)
阅读全文
摘要:序列化方法var jsonObj = { id: '01', name: 'Tom' }; JSON.stringify(jsonObj); 反序列化方法var jsonString = "{ id: '01', name: 'Tom' }"; JSON.parse(jsonString);来源: 来自为知笔记(Wiz)
阅读全文
摘要:Object.getOwnPropertyNames(data).length来自为知笔记(Wiz)
阅读全文
摘要://替换2个字符中间的字符alert(href.replace(/[^page=]+(?=&per-page)/, 0));来自为知笔记(Wiz)
阅读全文
摘要:js sleep效果 s = setInterval(function(){ //需要执行的函数 alert("我延迟了2秒弹出"); },2000);并不是每2秒执行一次,而是延迟2秒执行来自为知笔记(Wiz)
阅读全文
摘要:js中substring和substr的用法 substring 方法用于提取字符串中介于两个指定下标之间的字符substring(start,end)开始和结束的位置,从零开始的索引参数 描述start 必需。一个非负的整数,规定要提取的子串的第一个字符在 stringObject 中的位置。stop 可选。一个非负的整数,比要提取的子串的最后一个字符在 stringOb...
阅读全文
摘要:取消元素的原始事件/*** 对 page 链接 进行 表单的提交*/var links = document.getElementById("page");if(links){var linka=links.getElementsByTagName("a");for(var i=0;i<linka....
阅读全文
摘要:$(".test").prop("outerHTML");来自为知笔记(Wiz)
阅读全文
摘要:window.location属性 描述 hash 设置或获取 href 属性中在井号“#”后面的分段。 host 设置或获取 location 或 URL 的 hostname 和 port 号码。 hostname 设置或获取 location 或 URL 的主机名称部分。 href 设置或获取整个 URL 为字符串。 pathname 设置或获取对象指定的文件名或路径。 port 设置或获取...
阅读全文
摘要:Mozilla/5.0 (Linux; U; Android 2.3.6; zh-cn; GT-S5660 Build/GINGERBREAD) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1 MicroMessenger/4.5.255来自为知笔记(Wiz)
阅读全文
摘要://判断是否是pc function IsPC() { var userAgentInfo = navigator.userAgent; var Agents = new Array("Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod"); var flag = t...
阅读全文