c86f08c325
Co-Authored-By: Claude Code <noreply@anthropic.com>
24 lines
661 B
PHP
24 lines
661 B
PHP
<?php
|
||
/**
|
||
* 渠道新增计划删除接口 POST /api/channel/plan_delete.php
|
||
* 入参:id(必填);软删除(is_active = 0)
|
||
*/
|
||
require_once __DIR__ . '/../common/Api.php';
|
||
$pdo = Api::boot(['module' => 'channel']);
|
||
|
||
|
||
$id = (int)($_POST['id'] ?? 0);
|
||
if ($id <= 0) {
|
||
Response::error('参数错误', 400);
|
||
}
|
||
|
||
$pdo = DB::getInstance()->getPdo();
|
||
$stmt = $pdo->prepare("UPDATE channel_plans SET is_active = 0 WHERE id = ?");
|
||
$stmt->execute([$id]);
|
||
if ($stmt->rowCount() === 0) {
|
||
Response::error('计划不存在');
|
||
}
|
||
|
||
logCurrent('delete', 'channel_plan', 'channel_plans', $id, ['soft_delete' => true]);
|
||
Response::success(null, '删除成功');
|