ConfigServer::get('oa', 'name', ''), 'original_id' => ConfigServer::get('oa', 'original_id', ''), 'qr_code' => $qr_code, 'abs_qr_code' => UrlServer::getFileUrl($qr_code), 'app_id' => ConfigServer::get('oa', 'app_id', ''), 'app_secret' => ConfigServer::get('oa', 'secret', ''), 'url' => url('api/weChat/index','','',true), 'token' => ConfigServer::get('oa', 'token', 'LikeShop'), 'encoding_ses_key' => ConfigServer::get('oa', 'encoding_ses_key', ''), 'encryption_type' => ConfigServer::get('oa', 'encryption_type', 1), 'business_domain' => $domain_name, 'safety_domain' => $domain_name, 'auth_domain' => $domain_name, ]; return $config; } public static function setOa($post){ if($post){ if(!isset($post['encryption_type'])){ $post['encryption_type'] = ''; } ConfigServer::set('oa','name',$post['name']); ConfigServer::set('oa','original_id',$post['original_id']); ConfigServer::set('oa','qr_code',$post['qr_code']); ConfigServer::set('oa','app_id',$post['app_id']); ConfigServer::set('oa','secret',$post['app_secret']); ConfigServer::set('oa','token',$post['token']); ConfigServer::set('oa','encoding_ses_key',$post['encoding_ses_key']); ConfigServer::set('oa','encryption_type',$post['encryption_type']); } return true; } public static function pulishMenu($buttons){ try { $config = WeChatServer::getOaConfig(); if(empty($config['app_id']) || empty($config['secret'])){ return self::dataError('请先配置微信公众号参数'); } $app = Factory::officialAccount($config); $result = $app->menu->create($buttons); if($result['errcode'] == 0){ ConfigServer::set('menu','wechat_menu',$buttons); return self::dataSuccess('菜单发布成功'); } return self::dataError('菜单发布失败:'.json_encode($result)); } catch (Exception $e){ return self::dataError($e->getMessage()); } } public static function data($get){ $where = []; // //查询 if(isset($get['order_sn']) && $get['order_sn']!=''){ $where[] = ['order_sn','=',$get['order_sn']]; } if(isset($get['order_sn']) && $get['order_sn']!=''){ $where[] = ['order_sn','=',$get['order_sn']]; } if(isset($get['phone']) && $get['phone']!=''){ // $where[] = [$get['phone'],'like','%'.$get['phone'].'%']; $where[] = ['phone','=',$get['phone']]; } if(isset($get['area_id']) && $get['area_id']!=''){ $where[] = ['area_id','=',$get['area_id']]; } if(isset($get['channel_id']) && $get['channel_id']!=''){ $where[] = ['channel_id','=',$get['channel_id']]; } if(isset($get['status']) && $get['status']!=''){ $where[] = ['status','=',$get['status']]; } //下单时间检索 if(isset($get['start_time']) && $get['start_time']!=''){ $where[] = ['createtime','>=',strtotime($get['start_time'])]; } if(isset($get['end_time']) && $get['end_time']!=''){ $where[] = ['createtime','<=',strtotime($get['end_time'])]; } if(isset($get['consignee']) && $get['consignee']!=''){ $where[] = ['consignee', 'like', '%' . $get['consignee'] . '%']; } $user_count =Db::name('order_yearcard') ->where($where) ->count(); $user_list =Db::name('order_yearcard') ->where($where) ->page($get['page'],$get['limit']) ->order('id desc') ->select(); return ['count'=>$user_count , 'lists'=>$user_list]; } }