From 22bcf9a4ed1d998166d5b04b9113e488abcff0fe Mon Sep 17 00:00:00 2001 From: liuxiaoquan Date: Tue, 14 Mar 2023 11:57:42 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=B3=E8=AF=B7=E5=85=A5=E9=A9=BB=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E5=8A=9F=E8=83=BD=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/merchant/MerchantIntention.php | 55 +++---------------- app/admin/route/merchant.php | 2 +- 2 files changed, 9 insertions(+), 48 deletions(-) diff --git a/app/admin/controller/merchant/system/merchant/MerchantIntention.php b/app/admin/controller/merchant/system/merchant/MerchantIntention.php index ff98ef1..ae7b022 100644 --- a/app/admin/controller/merchant/system/merchant/MerchantIntention.php +++ b/app/admin/controller/merchant/system/merchant/MerchantIntention.php @@ -125,53 +125,10 @@ class MerchantIntention extends BaseController $rows = $this->intention->Edit($id, ['mark' => $mark]); - return $rows>0?to_assign(1, '修改成功'):to_assign(0, '修改失败'); + return $rows>0?to_assign(0, '修改成功'):to_assign(0, '修改失败'); } - /** - * 保存新建的资源 - * - * @param \think\Request $request - * @return \think\Response - */ - public function save(Request $request) - { - // - } - - /** - * 显示指定的资源 - * - * @param int $id - * @return \think\Response - */ - public function read($id) - { - // - } - - /** - * 显示编辑资源表单页. - * - * @param int $id - * @return \think\Response - */ - public function edit($id) - { - // - } - - /** - * 保存更新的资源 - * - * @param \think\Request $request - * @param int $id - * @return \think\Response - */ - public function update(Request $request, $id) - { - // - } + /** * 删除指定资源 @@ -179,9 +136,13 @@ class MerchantIntention extends BaseController * @param int $id * @return \think\Response */ - public function delete($id) + public function del() { - // + $id = get_params('id'); + if (!$this->intention->getWhereCount(['mer_intention_id' => $id, 'is_del' => 0])) + return to_assign(1,'数据不存在'); + $this->intention->Edit($id, ['is_del' => 1]); + return to_assign(0,'删除成功'); } } diff --git a/app/admin/route/merchant.php b/app/admin/route/merchant.php index 9a13da9..d7400eb 100644 --- a/app/admin/route/merchant.php +++ b/app/admin/route/merchant.php @@ -56,7 +56,7 @@ Route::group(function(){ Route::post('status', '/switchStatus')->name('systemMerchantIntentionStatus')->option([ '_alias' => '审核', ]); - Route::delete('delete', '/delete')->name('systemMerchantIntentionDelete')->option([ + Route::delete('del', '/del')->name('systemMerchantIntentionDelete')->option([ '_alias' => '删除', ]); Route::get('markform', '/markform')->name('systemMerchantIntentionMarkForm')->option([