作者 何书鹏
1 个管道 的构建 通过 耗费 1 秒

首页好物抢购

@@ -221,6 +221,44 @@ class House extends Api @@ -221,6 +221,44 @@ class House extends Api
221 } 221 }
222 222
223 /** 223 /**
  224 + * @ApiTitle (好物抢购)
  225 + * @ApiSummary (好物抢购)
  226 + * @ApiMethod (POST)
  227 + * @ApiRoute (/api/house/goods)
  228 + *
  229 + * @ApiHeaders (name=token, type=string, required=true, description="请求的Token")
  230 + *
  231 + * @ApiReturn({
  232 + "code": 1,
  233 + "msg": "success",
  234 + "time": "1598620381",
  235 + "data": [
  236 + {
  237 + "goods_id": 21,
  238 + "goods_name": "小米Mix3",
  239 + "goods_price": "3299.00",
  240 + "image": "https://her-family.oss-cn-qingdao.aliyuncs.com/addons_store_uploads/20181105/ffc4440df18661948b9c2d4dd4ae419b.jpg"
  241 + }
  242 + ]
  243 + })
  244 + */
  245 + public function goods()
  246 + {
  247 + $goods_ids = Db::name('config_goods')->where('id',1)->value('goods_ids');
  248 + $list = Db::name('litestore_goods')
  249 + ->where('goods_id','in',$goods_ids)
  250 + ->field('goods_id,goods_name,images')
  251 + ->select();
  252 + foreach($list as &$v){
  253 + $spec = Db::name('litestore_goods_spec')->where('goods_id',$v['goods_id'])->field('goods_price')->find();
  254 + $v['goods_price'] = $spec['goods_price'];
  255 + $v['image'] = explode(',',$v['images'])[0];
  256 + unset($v['images']);
  257 + }
  258 + $this->success('success',$list);
  259 + }
  260 +
  261 + /**
224 * @ApiTitle (社区列表) 262 * @ApiTitle (社区列表)
225 * @ApiSummary (社区列表) 263 * @ApiSummary (社区列表)
226 * @ApiMethod (POST) 264 * @ApiMethod (POST)
@@ -631,13 +631,13 @@ class HouseBoard extends Api @@ -631,13 +631,13 @@ class HouseBoard extends Api
631 631
632 private function init_wx_pay_for_gzh($Ischeck=false){ 632 private function init_wx_pay_for_gzh($Ischeck=false){
633 //这里首先判断 此用户是否绑定了微信公众号 633 //这里首先判断 此用户是否绑定了微信公众号
634 - // if($Ischeck){  
635 - // $third = Third::where(['user_id' => $this->auth->id, 'platform' => 'wechat'])->find();  
636 - // if(!$third){  
637 - // //从这里自动绑定微信公众号的账户  
638 - // $this->error('您未绑定微信号',null,1008);  
639 - // }  
640 - // } 634 + if($Ischeck){
  635 + $third = Third::where(['user_id' => $this->auth->id, 'platform' => 'wechat'])->find();
  636 + if(!$third){
  637 + //从这里自动绑定微信公众号的账户
  638 + $this->error('您未绑定微信号',null,1008);
  639 + }
  640 + }
641 641
642 $config = get_addon_config('litestore'); 642 $config = get_addon_config('litestore');
643 643
此 diff 太大无法显示。