04 2014 档案

摘要:直接上图,金山的APP“微信导航”,从界面上看有粉丝数等关键数据,实现了直接关注功能,莫不是rest接口?这江湖是大佬们的江湖,小喽啰只有眼馋的份咯。很早就听说过WeixinJSBridge,不过官方貌似不提倡,先晒晒学习笔记【Pockey】编辑整理//通过关注微信好友 function WeiXi... 阅读全文
posted @ 2014-04-24 09:33 Otgs 阅读(4910) 评论(0) 推荐(0)
摘要:'Post' , 'tags' = > 'Tag' , ) ; public function testFindPost( ) { //调用 find 时,我们使用 $condition 和 $params 指定查询条件。 //此处 $condition 可以是 SQL 语句中的 WHERE 字符串,$params 则是一个参数数组, //其中的值应绑定到 $condation 中的占位符。 $ post = $ th... 阅读全文
posted @ 2014-04-12 18:54 Otgs 阅读(353) 评论(0) 推荐(0)
摘要:CDbConnection: 一个抽象数据库连接CDbCommand: SQL statementCDbDataReader: 匹配结果集的一行记录CDbTransaction:数据库事务访问数据库前需要建立数据库连接;使用DAO建立一个抽象数据库链接:$connection = new CDbConnection($dsn, $username, $password);$connection->active = true; // 只有激活了连接才可以使用$connection->active = false; // 关闭连接CDbConnection继承自CApplication 阅读全文
posted @ 2014-04-12 17:38 Otgs 阅读(207) 评论(0) 推荐(0)
摘要:public function getMinLimit () { $sql = "..."; $result = yii::app()->db->createCommand($sql); $query = $result->queryAll(); return array ( $query [0] ['max'], ); }$connection=Yii::app()->db; $sql="SELECT u.account,i.* FROM sys_user as u left join user_info as i on 阅读全文
posted @ 2014-04-12 16:17 Otgs 阅读(1499) 评论(0) 推荐(0)
摘要:$str=preg_replace("/\s+/", " ", $str); //过滤多余回车$str=preg_replace("//si","",$str); //注释$str=preg_replace("//si","",$str); //过滤DOCTYPE$str=preg_replace("//si","",$str); //过滤html标签$str=preg_replace("//si","&q 阅读全文
posted @ 2014-04-10 09:52 Otgs 阅读(264) 评论(0) 推荐(0)