main($this->_listKey, 1000, '销售数据'); } private function _getBaseUrl($companyNo){ switch($companyNo){ case 106: return "http://erp.ahamu.cn"; case 117: return "http://fabld.ahamu.cn"; case 105: case 898: return "http://erp_qbb.ahamu.cn"; default : return false; } } public function mainFunc($requestArr){ try{ HelperService::$_startExecTime = microtime(true); $baseUrl = $this->_getBaseUrl($requestArr['company_no']); if(empty($baseUrl)){ return true; } $url = $baseUrl."/index/Index/sales"; $returnData = HelperService::httpPost($url, json_encode($requestArr), false); HelperService::$_sysParams = $requestArr; HelperService::addLog($returnData,$url,"ERP"); // return @json_decode($returnData,true); return true; } catch (\Exception $ex){ $mailService = new MailService(); $mailService->send('leo',"销售数据出队异常","",$ex->getMessage(),[['mail'=>'2990412861@qq.com','name'=>'leo.xie']]); } } public function stop(){ Cache::rm($this->_listKey.'_pop_program'); echo "restart success\n"; } public function getCache(){ $salesList = Cache::get($this->_listKey.'_pop_program'); var_dump($salesList); } }