Exemple #1
0
 function create_prom_event($action, $uid, $obj_id, $cash = 0, $credit = 0, $event_status = '1')
 {
     $result = FALSE;
     if ($this->_prom_open) {
         $prom_relation = $this->get_prom_relation($uid, $action);
         $r_status = intval($prom_relation['relation_status']);
         if ($prom_relation && $r_status != 3 && $r_status != 4 && $prom_relation['prom_uid'] != $uid) {
             if (!$this->get_prom_event($obj_id, $uid, $action, $event_status)) {
                 $income_rule = $this->get_income_rule($action, $obj_id, $cash, $credit);
                 $event_obj = new Keke_witkey_prom_event_class();
                 $event_obj->setEvent_desc($income_rule['event_desc']);
                 $event_obj->setUid($uid);
                 $event_obj->setUsername($prom_relation['username']);
                 $event_obj->setParent_uid($prom_relation['prom_uid']);
                 $event_obj->setParent_username($prom_relation['prom_username']);
                 $event_obj->setObj_id($obj_id);
                 $event_obj->setAction($income_rule['action']);
                 $event_obj->setRake_cash($income_rule['rake_cash']);
                 $event_obj->setRake_credit($income_rule['rake_credit']);
                 $event_obj->setEvent_time(time());
                 $event_obj->setEvent_status(intval($event_status));
                 $result = $event_obj->create_keke_witkey_prom_event();
                 $this->clear_prom_cookie();
             }
         }
     }
     return $result;
 }
 function create_prom_event($action, $uid, $obj_id, $cash = 0, $credit = 0, $event_status = '1')
 {
     $result = FALSE;
     $arrTaskInfo = db_factory::get_one(sprintf("select * from %switkey_task where task_id = %d", TABLEPRE, $obj_id));
     $arrBidInfo = db_factory::get_one(sprintf("select * from %switkey_task_bid where task_id = %d and bid_status = 4", TABLEPRE, $obj_id));
     if ($this->_prom_open) {
         $prom_relation = $this->get_prom_relation($uid, $action);
         $r_status = intval($prom_relation['relation_status']);
         if ($prom_relation && $r_status != 3 && $r_status != 4 && $prom_relation['prom_uid'] != $uid) {
             if (!$this->get_prom_event($obj_id, $uid, $action, $event_status)) {
                 if ($arrTaskInfo['model_id'] == 5) {
                     $cash = $arrBidInfo['quote'];
                 }
                 $income_rule = $this->get_income_rule($action, $obj_id, $cash, $credit);
                 $event_obj = new Keke_witkey_prom_event_class();
                 $event_obj->setEvent_desc($income_rule['event_desc']);
                 $event_obj->setUid($uid);
                 $event_obj->setUsername($prom_relation['username']);
                 $event_obj->setParent_uid($prom_relation['prom_uid']);
                 $event_obj->setParent_username($prom_relation['prom_username']);
                 $event_obj->setObj_id($obj_id);
                 $event_obj->setAction($income_rule['action']);
                 $event_obj->setRake_cash($income_rule['rake_cash']);
                 $event_obj->setRake_credit($income_rule['rake_credit']);
                 $event_obj->setEvent_time(time());
                 $event_obj->setEvent_status(intval($event_status));
                 $result = $event_obj->create_keke_witkey_prom_event();
                 $this->clear_prom_cookie();
             }
         }
     }
     return $result;
 }