diff --git a/app/admin/controller/merchant/system/merchant/MerchantIntention.php b/app/admin/controller/merchant/system/merchant/MerchantIntention.php index 32991e5..e6e7b4f 100644 --- a/app/admin/controller/merchant/system/merchant/MerchantIntention.php +++ b/app/admin/controller/merchant/system/merchant/MerchantIntention.php @@ -128,53 +128,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) - { - // - } + /** * 删除指定资源 @@ -182,9 +139,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([