上一页 1 ··· 4 5 6 7 8 9 10 下一页
摘要: http://php.net/manual/zh/function.array-map.php 为数组的每个元素应用回调函数; 应用: 为数组元素添加前缀 阅读全文
posted @ 2018-09-15 16:31 百事可口 阅读(148) 评论(0) 推荐(0)
摘要: eg: $where= ['AND']; $where[] = ['title' => $set_menu['title'],'type' => $type]; if (!empty($id)) { $where[] = ['<>', 'id', $id]; } ....->Where($where 阅读全文
posted @ 2018-09-04 17:04 百事可口 阅读(505) 评论(0) 推荐(0)
摘要: 就是不使用 use 加载 eg: $test = 'News'; $aa = 'Wechat'.$test.'Reply'; $modelName = "\\backend\\models\\wechat\\{$aa}"; $newsReply = $modelName::findOne(['rid 阅读全文
posted @ 2018-08-24 16:46 百事可口 阅读(213) 评论(0) 推荐(0)
摘要: 多商户设计 关键字触发 查找rule_keyword表 -> rule表 -> 回复资源表【news_reply 图文表、images_reply 图片表、video_reply 视频表......】得到资源返回 rule表 字段id, uniacid, name, module, displayo 阅读全文
posted @ 2018-08-17 15:34 百事可口 阅读(695) 评论(0) 推荐(0)
摘要: yii2 composer 安装完 ueditor 后 目录: \vendor\kucha\ueditor 修改Uploader.php文件 添加: use common\helpers\MyHelper;//引入你的OSS代码 我把它用静态方法upload()写在MyHelper 在private 阅读全文
posted @ 2018-08-04 14:35 百事可口 阅读(364) 评论(0) 推荐(0)
摘要: 转:https://blog.csdn.net/baidu_30000217/article/details/49666647 类的类型提示 - 将类名放在需要约束的方法参数之前 语法格式: public function write(ShopProduct $shopProduct){} 数组提示 阅读全文
posted @ 2018-07-31 00:32 百事可口 阅读(187) 评论(0) 推荐(0)
摘要: http://php.net/manual/zh/language.operators.type.php 阅读全文
posted @ 2018-07-31 00:30 百事可口 阅读(120) 评论(0) 推荐(0)
摘要: 转:https://blog.csdn.net/hanliuxinming/article/details/20879965 阅读全文
posted @ 2018-07-27 00:48 百事可口 阅读(855) 评论(0) 推荐(0)
摘要: foreach是对数组副本进行操作(通过拷贝数组),而while则通过移动数组内部指标进行操作,一般逻辑下认为,while应该比foreach快(因为foreach在开始执行的时候首先把数组复制进去,而while直接移动内部指标。),但结果刚刚相反。 在循环里进行的是数组“读”操作,则foreach 阅读全文
posted @ 2018-07-21 14:42 百事可口 阅读(164) 评论(0) 推荐(0)
摘要: $tt = Yii::$app->db->beginTransaction();//开启事务 try { //执行一系列数据库操作 $tt->commit(); //没有报错就提交 } catch (Exception $e){ $tt->rollBack(); //报错回滚 } 阅读全文
posted @ 2018-07-13 10:04 百事可口 阅读(85) 评论(0) 推荐(0)
上一页 1 ··· 4 5 6 7 8 9 10 下一页