/** * 手动暂停金铺经纪人的定价计划 * * @param int $ajkBrokerId * @param int $cityId */ private function stopJpFixPlan($ajkBrokerId, $cityId) { $jpBrokerId = Bll_Broker_User::getJpBrokerInfoByAjkBrokerId($ajkBrokerId); if ($jpBrokerId == 0) { $this->logMsg(sprintf('经纪人[%d - %d]没有获取到金铺经纪人ID。', $cityId, $ajkBrokerId)); return; } $this->logMsg(sprintf('经纪人[%d - %d - %d]金铺的定价计划,处理开始。', $cityId, $ajkBrokerId, $jpBrokerId)); $spreadingPlanList = Bll_Plan_Fix_JpPlan::getValidaFixPlanByMemberId($jpBrokerId); $insufficientBalancePlanList = Bll_Plan_Fix_JpPlan::getStopByInsufficientBalancePlanList($jpBrokerId); $fixPlanList = array_merge($spreadingPlanList, $insufficientBalancePlanList); if (empty($fixPlanList)) { $this->logMsg(sprintf('经纪人[%d - %d - %d]没有获取到金铺定价计划。', $cityId, $ajkBrokerId, $jpBrokerId)); return; } $data = array('houseId' => 0, 'planId' => 0, 'brokerId' => $ajkBrokerId, 'cityId' => $cityId, 'type' => 207, 'remark' => '切新端口,暂停定价计划', 'flag' => 0, 'addDate' => time(), 'dealRemark' => '', 'operateId' => 0, 'from' => __METHOD__, 'siteType' => 3); foreach ($fixPlanList as $fixPlan) { $this->logMsg(json_encode($fixPlan)); if (false == Bll_Plan_Fix_JpPlan::stopPlanByHand($fixPlan['id'])) { $this->logMsg(sprintf('经纪人[%d - %d - %d]定价计划[%d - %d]手动暂停失败。', $cityId, $ajkBrokerId, $jpBrokerId, $fixPlan['id'], $fixPlan['stopReason'])); continue; } $this->logMsg(sprintf('经纪人[%d - %d - %d]定价计划[%d - %d]手动暂停成功。', $cityId, $ajkBrokerId, $jpBrokerId, $fixPlan['id'], $fixPlan['stopReason'])); /** * 记录上下架队列 */ $data['planId'] = $fixPlan['id']; if (!Model_House_UpDown_Task::create($data, date('Ymd'))->save()) { $this->logMsg(sprintf('%s 记录上下架队列失败。', json_encode($data))); } else { $this->logMsg(sprintf('%s 记录上下架队列成功。', json_encode($data))); } } $this->logMsg(sprintf('经纪人[%d - %d - %d]金铺的定价计划,处理结束。', $cityId, $ajkBrokerId, $jpBrokerId)); }