yii2 联表查询的时候,会出现主键覆盖的问题,采用indexBy()中传匿名函数解决。
在打印原始sql的时候,到数据库中查询出来有44条记录,但是通过程序取出来只有1条记录。
先记录一下,详细的原因后续再看底层代码。
public function searc...
lampnick
8年前 (2016-11-23) 4285℃ 0评论
5喜欢
$GLOBALS['start'] = microtime(true);
$GLOBALS['end'] = microtime(true);
$runtime = $GLOBALS['end']-$GLOBALS['start'];
echo number_form...
lampnick
8年前 (2016-11-23) 2899℃ 0评论
1喜欢
今天遇到一个微信的问题,在发布微信菜单时,微信返回错误代码:{"errcode":40001,"errmsg":"invalid credential, access_token is invalid or not latest hint: [0722vr31!]"}。
一直以为...
lampnick
8年前 (2016-11-14) 20702℃ 0评论
73喜欢
curl -H "Content-Type: application/json" -X POST --data '{"data":"1"}' http://127.0.0.1/
转载自:https://my.oschina.net/code33/blog/417424
转载...
lampnick
8年前 (2016-11-14) 3492℃ 0评论
13喜欢