花椒
- 花椒 2015-08-01 已签到连续签到6天,获得了20个金钱
- 花椒 2015-07-31 已签到连续签到5天,获得了20个金钱
- 花椒 2015-07-30 已签到连续签到4天,获得了20个金钱
- 花椒 回答了问题 yii2 设置 cookie 的问题
CTRL+F5刷新看~
- 花椒 回答了问题 js文件加载超时放弃加载
下面是无阻塞加载脚本的技术方案:
XHR Eval顾名思义,通过XHR读取脚本,通过Eval令脚本生效。
代码如下:var xhrObj = new XMLHttpRequest(); xhrObj.onreadystatechange = function(){ if(xhrObj.readyState == 4 && 200 == xhrObj.status){ eval(xhrObj.responseText); } }; xhrObj.open("GET", "A.js", true); xhrObj.send("");
由于XMLHttpRequest本身不能跨域,所以该方法不能跨域。
参考:http://www.cnblogs.com/sharpxiajun/p/4072396.html 其实你如果想查店面的商品,是应该在店面的模型里做关联查询的~参考:
class Mall extends \yii\db\ActiveRecord { public function getGoodses() { return $this->hasMany(Goods::className(), ['id' => 'goods_id']) ->viaTable('MallToGoods', ['mall_id' => 'id']); } }
然后查询某店商品用:
$mall=Mall::findOne($id); //使用时: $goodses=$mall->goodses(); foreach ($goodses as $goods) { .... }
其实你如果想查店面的商品,是应该在店面的模型里做关联查询的~参考:
class Mall extends \yii\db\ActiveRecord { public function getGoodses() { return $this->hasMany(Goods::className(), ['id' => 'goods_id']) ->viaTable('MallToGoods', ['mall_id' => 'id']); } }
- 花椒 2015-07-29 已签到连续签到3天,获得了15个金钱
- 花椒 回答了问题 Yii2 返回某个列怎么写?
建议用PhpStorm吧,有代码提示,能跟踪,很容易上手的~
- 花椒 2015-07-28 已签到连续签到2天,获得了10个金钱