/**
  * @param $groupId
  * @param $data
  * @return bool
  */
 public static function updateBrokerGroup($groupId, $data)
 {
     try {
         $obj = Model_Broker_HzBBrokerGroup::data_access();
         $obj->filter('groupId', $groupId);
         foreach ($data as $field => $value) {
             $obj->set_field($field, $value);
         }
         return $obj->update() ? true : false;
     } catch (Exception $e) {
         return false;
     }
 }
 private function dealTask($group)
 {
     if (!($areaCode = $group['areaCode'])) {
         return false;
     }
     if (!($areaInfo = Model_City_HzArea::getAreaByTypeCode($areaCode))) {
         return false;
     }
     $areaId = $areaInfo['parentId'] ? $areaInfo['parentId'] : 0;
     $blockId = $areaInfo['id'] ? $areaInfo['id'] : 0;
     $companyId = $group['cstCompanyId'];
     // 是否大客户
     $isBigCompany = Model_Broker_HzBBrokerCompany::isBigCompany($companyId);
     // 获取销售资源分配
     $hzResource = Model_PPC_HzCSalesResources::getResource($areaId, $blockId, $isBigCompany ? $companyId : 0);
     $sellerId = $hzResource ? $hzResource['sellerId'] : 0;
     // 判断公司是否已经同步,同步过的更新
     $hzGroup = Model_Broker_HzBBrokerGroup::getBrokerGroupByGroupId($group['comanyId']);
     // 组装数据insert|update
     $content = array('shortName' => $group['shortCompanyName'], 'address' => $group['comanyAddr'], 'phone' => $group['comanyTel'], 'fax' => $group['comanyFax'], 'summery' => $group['comanySummery']);
     $data = array('groupId' => $group['comanyId'], 'name' => $group['comanyName'], 'storeId' => $group['realStoreId'], 'companyId' => $companyId, 'cityId' => $group['cityId'], 'contact' => $group['comanyLinkMan'], 'flag' => $group['isActive'], 'areaId' => $areaId, 'blockId' => $blockId, 'content' => json_encode($content), 'updated' => time(), 'mid' => 0, 'sellId' => $sellerId);
     if ($hzGroup) {
         $result = Model_Broker_HzBBrokerGroup::updateBrokerGroup($group['comanyId'], $data);
         printf('[%s] update: groupId: %s  result: %s' . PHP_EOL, date('Y-m-d H:i:s'), $group['comanyId'], $result);
         return $result;
     } else {
         $result = Model_Broker_HzBBrokerGroup::addBrokerGroup($data);
         printf('[%s] add: result: %s' . PHP_EOL, date('Y-m-d H:i:s'), $result);
         return $result;
     }
 }