function back_point($data, $memo = '') { if (!is_array($data)) { $data = $this->conn->GetRow("select * from " . $this->table . " where id='" . $data . "'"); } if ($data && $data["member_id"] != '' && $data["addpoint_status"] == '1') { $member = new member($this->conn, PREFIX . "member"); $member->getmember(" where id='" . $data["member_id"] . "'", 'login'); $ind['shopping_car_id'] = $data["id"]; $member->point_work($data["addpoint"] * -1, $memo != '' ? $memo : '訂單' . $order_no . '移除紅利', $ind); $this->conn->Execute("UPDATE " . $this->table . " SET addpoint_status=0 where id='" . $data["id"] . "'"); } }
$loadata = $conn->GetRow("select * from " . $_POST["table"] . " where " . $where_sql); $loadata[$_POST["row"]] = explode('|__|', $loadata[$_POST["row"]]); $loadata[$_POST["row"]][$temp_str_add[1] * 1] = quotes($_POST["editabledata"]); $indata[$_POST["row"]] = implode('|__|', $loadata[$_POST["row"]]); } else { $indata[$_POST["row"]] = quotes($_POST["editabledata"]); } if ($_SESSION["admin_info"]["account"] && $conn->AutoExecute($_POST["table"], $indata, "UPDATE", $where_sql)) { echo '更新成功'; } else { echo '更新失敗'; } } //--訂單紅利操作 if ($_GET["back_point"]) { $member = new member($conn, PREFIX . "member"); $check_data = $conn->GetRow("select * from " . PREFIX . "shopping_car where id='" . $_GET["back_point"] . "'"); $member->getmember(" where id='" . $check_data["member_id"] . "'", 'login'); $member->work(); if ($check_data["addpoint_status"] == '1') { $member->point_work($check_data['addpoint'] * -1, '後台訂單調整回收紅利'); $conn->Execute("UPDATE " . PREFIX . "shopping_car SET addpoint_status=0 where id='" . $_GET["back_point"] . "'"); echo '已回收紅利點數'; exit; } else { $member->point_work($check_data['addpoint'], '後台訂單調整發放紅利'); $conn->Execute("UPDATE " . PREFIX . "shopping_car SET addpoint_status=1 where id='" . $_GET["back_point"] . "'"); echo '已發放紅利點數'; exit; } }