wqData['uniacid']); if($result['ident']=='system'){ $color=Config::getSystemSet('style',$this->wqData['uniacid']); $res['color']=$color['color']?:'#DBA86F'; $name=Config::getSystemSet('customName',$this->wqData['uniacid']); $res['custom']=$name; $res['custom']['live']=$name['live']?:'直播列表'; $res['custom']['takeOut']=$name['takeOut']?:'外卖'; $res['custom']['integral']=$name['integral']?:'积分'; $res['custom']['balance']=$name['balance']?:'余额'; $res['custom']['rechargeTitle']=$name['rechargeTitle']?:'充值中心'; $res['custom']['systemRedbag']=$name['systemRedbag']?:'平台红包'; $res['custom']['orderNumber']=$name['orderNumber']?:'取单号'; $res['custom']['informationTitle']=$name['informationTitle']?:'资讯中心'; $res['custom']['hbfh']=$name['hbfh']?:'¥'; $res['custom']['hbmc']=$name['hbmc']?:'元'; $res['custom']['inStore']=$name['inStore']?:'店内'; $member=Config::getSystemSet('member',$this->wqData['uniacid']); $res['member']['payType']=$member['payType']?:1; $storeSet=Config::getSystemSet('storeSet',$this->wqData['uniacid']); $res['storeSet']['showType']=$storeSet['showType']?:1; $power=Power::getPower($this->wqData['uniacid']); $res['storeSet']['storeModel']=$power['shopModel']?:2; $res['copyright']['support']=Power::getPower($this->wqData['uniacid'],'support')['support']?:''; $switch=Config::getSystemSet('currency',$this->wqData['uniacid']); $res['switch']['scribingPriceShow']=$switch['scribingPriceShow']?:1; $res['switch']['saleShow']=$switch['saleShow']?:1;// $res['switch']['stockShow']=$switch['stockShow']?:1; $res['powerList']['instore']=Power::getPower($this->wqData['uniacid'],'instore')['instore']?:1; $res['powerList']['takeout']=Power::getPower($this->wqData['uniacid'],'instore')['takeout']?:1; $res['powerList']['queuing']=Power::getPayPower($this->wqData['uniacid'],'queuing')?1:0; $res['powerList']['reserve']=Power::getPayPower($this->wqData['uniacid'],'reserve')?1:0; } if($result['ident']=='collection'){ $res['couponArr']=[]; if($res['isCoupon']==1){ $list=(new \yii\db\Query()) ->select('id,name,timeType,useEndTime,isNextDay,day,isFull,fullMoney,type,money,discount') ->from('{{%ybwm_coupon}}') ->where(['in','id',$res['coupon']]) ->all(); for($i=0;$iresult(1,'成功',$res); } //查看模板id public function actionTemplateList() { $appType=$this->wqData['appType']; $res=Config::getSystemSet('miniTemplates',$this->wqData['uniacid']); if($appType==3){ $res=Config::getSystemSet('aliTemplates',$this->wqData['uniacid']); } $data['saveOrder']=[]; $data['payOrder']=[]; $data['cashierOrder']=[]; if($res['payOkTid']){ $data['saveOrder'][]=$res['payOkTid']; } if($res['takeTid']){ $data['saveOrder'][]=$res['takeTid']; } if($res['deliveryTid']){ $data['saveOrder'][]=$res['deliveryTid']; } if($res['refuseTid']){ $data['payOrder'][]=$res['refuseTid']; } if($res['acceptTid']){ $data['payOrder'][]=$res['acceptTid']; } if($res['refundResultTid']){ $data['payOrder'][]=$res['refundResultTid']; } if($res['cashierTid']){ $data['cashierOrder'][]=$res['cashierTid']; } if($res['fastTakeTid']){ $data['fastOrder'][]=$res['fastTakeTid']; } if($res['inOrderTid']){ $data['inStoreOrder'][]=$res['inOrderTid']; } if($res['queuingTid']){ $data['queuingOrder'][]=$res['queuingTid']; } return $this->result(1,'成功',$data); } //坐标转地址 public function actionCoordinateToAdd() { $result=axios_request(); $coordinate=$result['lat'].','.$result['lng']; $set = Config::getSystemSet('system', $this->wqData['uniacid']); $txKey=$set['txKey']?:Yii::$app->params['txKey']; $location = "https://apis.map.qq.com/ws/geocoder/v1/?location=" . $coordinate . "&key=" . $txKey. "&get_poi=0"; $coordinate = httpRequest($location); $coordinate = json_decode($coordinate, true); return $this->result(1, '成功', $coordinate); } //获取单个拖拽式数据 public function actionGetDragRow(){ $result=axios_request(); $pageId=$result['pageId']; if($pageId){ $info=(new \yii\db\Query()) ->select('id,body') ->from('{{%ybwm_drag}}') ->where(['deleteAt'=>0,'id'=>$pageId,'display'=>1,'uniacid'=>$this->wqData['uniacid']]) ->one(); $info['body']=json_decode($info['body'],true)?:[]; return $this->result(1, '成功', $info); } $info=(new \yii\db\Query()) ->select('id,body') ->from('{{%ybwm_drag}}') ->where(['deleteAt'=>0,'page'=>$result['id'],'display'=>1,'uniacid'=>$this->wqData['uniacid']]) ->one(); if(!$info){ Drag::getDefault($this->wqData['uniacid'],$result['id']); $info=(new \yii\db\Query()) ->select('id,body') ->from('{{%ybwm_drag}}') ->where(['deleteAt'=>0,'page'=>$result['id'],'display'=>1,'uniacid'=>$this->wqData['uniacid']]) ->one(); } $info['body']=json_decode($info['body'],true)?:[]; return $this->result(1, '成功', $info); } //获取小程序直播 public function actionGetMiniLive(){ $result=axios_request(); $page=$result['page']; $size=$result['size']?:10; $table=(new \yii\db\Query()) ->from('{{%ybwm_live}}') ->where('uniacid=:uniacid',[':uniacid'=>$this->wqData['uniacid']]); $res=$table->offset(($page - 1) * $size)->limit($size)->all(); // $res=WeChat::getMiniLive($this->wqData['uniacid'],$result['page'],$result['size']); return $this->result(1, '成功', $res); } //获取小程序公告 public function actionGetArticleList(){ $result=axios_request(); $type=$result['type']?:1; if($type==1){ $storeId=Store::getMainStore($this->wqData['uniacid'])['id']; }else{ $storeId=$result['storeId']; } $uniacid=$this->wqData['uniacid']; $data=(new \yii\db\Query()) ->select('id,title,introduction,from_unixtime(createdAt)createdAt,body') ->from('{{%ybwm_notice}}') ->where(['deleteAt'=>0,'uniacid'=>$uniacid,'display'=>1,'noticeType'=>1,'storeId'=>$storeId]) ->orderBy('id desc')->all(); return $this->result(1, '成功', $data); } public function actionGetCode(){ $result=axios_request(); $page=WeChat::getQrCode($this->wqData['uniacid'],$this->wqData['module'],$result['page'],$result['ident'],$result['scene']); return $this->result(1, '成功', $page); } //上传图片 public function actionUpload(){ //print_R($_FILES['file']);die; $config=Config::getSystemSet('storage',$this->wqData['uniacid']); if($config['type']==1){ $fname=File::qiniuUpload('file',$this->wqData['module'],$this->wqData['uniacid'],$config); }elseif($config['type']==2){ $fname=File::aliUpload('file',$this->wqData['module'],$this->wqData['uniacid'],$config); }elseif($config['type']==3){ $fname=File::txyUpload('file',$this->wqData['module'],$this->wqData['uniacid'],$config); }else{ $fname=File::channelUploadImage('file','',$this->wqData['module'],$this->wqData['uniacid']); } return $fname; } //资讯 public function actionInformation(){ $result=axios_request(); $storeId=$result['storeId']; $page=$result['page']?:1; $size=$result['size']?:10; if($storeId){ $table=(new \yii\db\Query()) ->from('{{%ybwm_information}}') ->where('uniacid=:uniacid AND storeId=:storeId AND type=1 AND display=1 AND deleteAt=0',[':uniacid'=>$this->wqData['uniacid'],':storeId'=>$storeId]); }else{ $table=(new \yii\db\Query()) ->from('{{%ybwm_information}}') ->where('uniacid=:uniacid AND type=1 AND display=1 AND deleteAt=0',[':uniacid'=>$this->wqData['uniacid']]); } $res=$table->offset(($page - 1) * $size)->limit($size)->orderBy('sort asc,id desc')->all(); return $this->result(1, '成功', $res); } //资讯详情 public function actionInformationInfo(){ $result=axios_request(); $res=(new \yii\db\Query()) ->select('a.*,s.name as storeName') ->from('{{%ybwm_information}} as a') ->join('LEFT JOIN', '{{%ybwm_store}} as s', 's.id = a.storeId') ->where('a.id=:id AND a.deleteAt=0',[':id'=>$result['id']])->one(); if($res){ Yii::$app->db->createCommand()->update('{{%ybwm_information}}', ['views'=>new \yii\db\Expression('views + 1')], 'id=:id', ['id' =>$result['id']])->execute(); return $this->result(1, '成功', $res); } return $this->result(1, '成功', []); } //通过活码id查找参数 public function actionGetCodeData(){ $result=axios_request(); $info=(new \yii\db\Query()) ->from('{{%ybwm_code}}') ->where('id=:id',[':id'=>$result['id']])->one(); $data=json_decode($info['data'],true); return $this->result(1, '成功', $data); } public function actionGetStoreConfig(){ $result=axios_request(); $res=Config::getStoreSet($result['ident'],$result['storeId']); return $this->result(1, '成功', $res); } }