public function collect_cancel(Request $request, Response $response) { if ($request->is_post()) { $res = ['flag' => 'FAIL', 'msg' => '取消失败']; $ec_user_id = $GLOBALS['user']->ec_user_id; if (!$ec_user_id) { $res['msg'] = '未登录, 请登录'; $response->sendJSON($res); } $rec_id = $request->post('rec_id', 0); if (!$rec_id) { $res['msg'] = '记录id为空'; $response->sendJSON($res); } $b = Goods::goodsCollectCancel($rec_id); if ($b) { $res = ['flag' => 'SUC', 'msg' => '取消成功']; } $response->sendJSON($res); } }