Beispiel #1
0
 /**
  * 竞价写入数据(计划表,关联关系表,竞价扩展表)
  */
 public static function into_bid_tables($proid, $offer, $broker_id, $amount, $city_id, $sn)
 {
     //添加计划
     $plan_id = Dao_Broker_HzPlan::add_plan('竞价计划', Const_HzPlan::BID_TYPE, $broker_id, $amount, Const_HzPlan::SPREAD);
     if ($plan_id) {
         Dao_Broker_HzPlan::add_bid_extend($plan_id, $sn);
         //竞价扩展表
         if (Dao_Broker_HzPlan::add_planning($proid, $broker_id, $city_id, $plan_id, Const_HzPlan::BID_TYPE, $offer, 1)) {
             return $plan_id;
         }
         //计划关联表
         return false;
     }
     return false;
 }
Beispiel #2
0
 /**
  * 单个房源加入定价组
  */
 public static function prop_into_fix($broker_id, $proid, $plan_id)
 {
     //房源加入定价组 条件判断
     $flag_array = array('status' => 0, 'msg' => '');
     $plan_info = Dao_Broker_HzPlan::get_plan($plan_id);
     if (empty($plan_info)) {
         $flag_array['msg'] = Const_HzErrorInfo::NULLPLAN;
         return $flag_array;
     }
     if ($plan_info['user_id'] != $broker_id) {
         $flag_array['msg'] = Const_HzErrorInfo::PLANINFOERROR;
         return $flag_array;
     }
     $planning_num = Dao_Broker_HzPlan::get_planning($plan_id);
     $total_num = count($planning_num[0]);
     if ($total_num >= Const_HzPlan::PLAN_PROP_NUM) {
         $flag_array['msg'] = Const_HzErrorInfo::FIXPROPTOP;
         return $flag_array;
     }
     $propinfo = Dao_Broker_HzProp::get_prop($proid);
     if ($propinfo) {
         $basic_info = $propinfo[$proid]['content_basic'];
         if (in_array($basic_info['status'], array(1, 6, 99, 100)) || $basic_info['userid'] != $plan_info['user_id']) {
             $flag_array['msg'] = Const_HzErrorInfo::PROPERROR;
             return $flag_array;
         }
         $prop_planning = Dao_Broker_HzPlan::get_prop_planning($proid);
         if (!empty($prop_planning)) {
             $flag_array['msg'] = Const_HzErrorInfo::PROPFIX;
             return $flag_array;
         }
         $pro_status = self::get_propstatus_from_planstatus($plan_info['status']);
         if (Dao_Broker_HzProp::change_prop_status($proid, $pro_status)) {
             //更新房源状态
             $unit_price = self::get_minoffer($basic_info['pricenum'], $basic_info['cityid']);
             if (Dao_Broker_HzPlan::add_planning($proid, $basic_info['userid'], $basic_info['cityid'], $plan_id, Const_HzPlan::SPREAD_TYPE, $unit_price, $plan_info['status'])) {
                 //写入关联关系
                 $log_option = self::get_option_by_status($plan_info['status']);
                 Dao_Broker_HzPlan::add_prop_log($proid, $log_option, $basic_info['userid'], $plan_id, $basic_info['status'], $pro_status, true);
                 //记房源日志
                 if ($basic_info['status'] != Const_HzStatus::ONLINE && $pro_status == Const_HzStatus::ONLINE) {
                     Dao_Broker_HzProp::into_prop_lucene($proid, $basic_info['cityid'], 1);
                     //写日志
                     Dao_Broker_HzProp::add_updown_log($proid, $plan_id, Const_HzStatus::GOONLINE, $log_option);
                 }
                 $flag_array['status'] = 1;
                 return $flag_array;
             }
         }
     }
     $flag_array['msg'] = Const_HzErrorInfo::DONEFAIL;
     return $flag_array;
 }