public static function exec_rate($mark_status, $uid, $mark_cash, $model_code, $mark_type = '2') { $mark_type == 1 and $edit_col = "buyer_credit" or $edit_col = "seller_credit"; if ($model_code == 'preward' && floatval($mark_cash) < 1) { $mark_value = 0; } else { $mark_value = self::get_mark_score($mark_type, $model_code, $mark_cash, $mark_status); } $mark_status == 1 and $seller_good_num = 1 or $seller_good_num = 0; $credit_value = db_factory::get_count(sprintf("select %s from %switkey_space where uid = '%d'", $edit_col, TABLEPRE, $uid)); $mark_type == '2' and $level_role = '1' or $level_role = '2'; $user_levels = self::get_mark_level($credit_value + $mark_value, $level_role); $user_level = serialize($user_levels); if ($mark_type == 1) { $space_array = array("buyer_credit" => "`buyer_credit` + {$mark_value}", "buyer_good_num" => "`buyer_good_num`+{$seller_good_num}", "buyer_total_num" => "`buyer_total_num`+1", "buyer_level" => "{$user_level}"); } elseif ($mark_type == 2) { $space_array = array("seller_credit" => "`seller_credit`+ {$mark_value}", "seller_good_num" => "`seller_good_num` +{$seller_good_num}", "seller_total_num" => "`seller_total_num`+1", "seller_level" => "{$user_level}"); } $wheresqlarr = array("uid" => $uid); keke_table_class::updateself("witkey_space", $space_array, $wheresqlarr); }