From ae3879070facf2129496f88f9c9ace10b7cbef5c Mon Sep 17 00:00:00 2001 From: yanzai Date: Sat, 9 Nov 2024 15:30:43 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=8E=A8=E8=8D=90=E5=A5=97=E9=A4=90?= =?UTF-8?q?=E8=BF=87=E6=BB=A4=E6=80=A7=E5=88=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Laravel/app/Http/Controllers/API/H5/ComboController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Laravel/app/Http/Controllers/API/H5/ComboController.php b/Laravel/app/Http/Controllers/API/H5/ComboController.php index 4ad11ad..916329d 100644 --- a/Laravel/app/Http/Controllers/API/H5/ComboController.php +++ b/Laravel/app/Http/Controllers/API/H5/ComboController.php @@ -599,10 +599,10 @@ select combo_id as c_id,count(*) as sale_count from orders where status in(2,4) $ids= "'" . implode("','", $topTwoIndexes) . "'"; - + $sex=$person->sex; $combos = DB::select("select * from combos as a LEFT JOIN ( select combo_id as c_id,count(*) as count from orders where status in(2,4) group by combo_id -) as b on a.combo_id=b.c_id where a.status=1 and a.combo_id in (".$ids.")"); +) as b on a.combo_id=b.c_id where a.status=1 and a.combo_id in (".$ids.") and a.sex in(".$sex.",0)"); foreach ($combos as $key => $combo) { From 03f261a89ac4bfddadd7abd3df9754d8e36a3200 Mon Sep 17 00:00:00 2001 From: yanzai Date: Sat, 9 Nov 2024 17:09:13 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=90=8E=E5=8F=B0=E5=AE=8C=E5=96=84?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=8F=B7=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../API/Admin/YeWu/PlanController.php | 15 +++++++- Laravel/routes/api.php | 1 + admin/src/api/api.js | 4 ++ admin/src/views/PlanMngr/Plan.vue | 37 ++++++++++++++++++- 4 files changed, 54 insertions(+), 3 deletions(-) diff --git a/Laravel/app/Http/Controllers/API/Admin/YeWu/PlanController.php b/Laravel/app/Http/Controllers/API/Admin/YeWu/PlanController.php index 9d85eaf..1150667 100644 --- a/Laravel/app/Http/Controllers/API/Admin/YeWu/PlanController.php +++ b/Laravel/app/Http/Controllers/API/Admin/YeWu/PlanController.php @@ -36,7 +36,7 @@ class PlanController extends Controller // $planType = DB::table('plan_type as a')->where(['a.id' => $model->plan_type, 'a.is_del' => 0, 'a.status' => 1])->first(); // if (!$planType) return \Yz::echoError1('号源类型不可用'); //查询此时间段内是否有已经生成的号源 - $cha = DB::table('plans')->whereBetween('date', $Info['dateRange'])->get(); + $cha = DB::table('plans')->whereBetween('date', $Info['dateRange'])->where(['is_del'=>0])->get(); if (count($cha) > 0) { return \Yz::return(false, '号源重复', ['list' => $cha]); } @@ -133,7 +133,7 @@ class PlanController extends Controller public function GetDetail() { $id = request('id'); - $info = DB::table('plans')->where(['id' => $id])->first(); + $info = DB::table('plans')->where(['id' => $id,'is_del'=>0])->first(); if (!!$info) { if(empty($info->checkup_type_id)){ $info->checkup_type_id='[]'; @@ -209,4 +209,15 @@ class PlanController extends Controller } } + public function Del() + { + $ids = request('ids'); + $del=DB::table('plans')->whereIn('id', $ids)->where(['status'=>1])->update(['is_del'=>1]); + if($del){ + return \Yz::Return(true, '操作成功', []); + }else{ + return \Yz::echoError1('操作失败'); + } + + } } diff --git a/Laravel/routes/api.php b/Laravel/routes/api.php index 49bdc02..bfabef9 100644 --- a/Laravel/routes/api.php +++ b/Laravel/routes/api.php @@ -90,6 +90,7 @@ Route::group(['middleware' => ['checktoken', 'log'], 'prefix' => 'v1'], function Route::post('admin/PlanGetList', 'App\Http\Controllers\API\Admin\YeWu\PlanController@GetList');//号源列表 Route::post('admin/PlanGetDetail', 'App\Http\Controllers\API\Admin\YeWu\PlanController@GetDetail');//号源详情 Route::post('admin/PlanSave', 'App\Http\Controllers\API\Admin\YeWu\PlanController@Save');//保存号源详情 + Route::post('admin/PlanDel', 'App\Http\Controllers\API\Admin\YeWu\PlanController@Del');// Route::post('admin/PlanBatchUpdatePlanType', 'App\Http\Controllers\API\Admin\YeWu\PlanController@BatchUpdatePlanType');//保存号源详情 Route::post('admin/ComboGetList', 'App\Http\Controllers\API\Admin\YeWu\ComboController@GetList');//获取套餐列表 diff --git a/admin/src/api/api.js b/admin/src/api/api.js index b2cc229..f573537 100644 --- a/admin/src/api/api.js +++ b/admin/src/api/api.js @@ -171,6 +171,10 @@ export const PlanGetDetail = (data = {}) => { export const PlanSave = (data = {}) => { return axios({ url: import.meta.env.VITE_APP_API + 'v1/admin/PlanSave', data: data }) } +//号源del +export const PlanDel = (data = {}) => { + return axios({ url: import.meta.env.VITE_APP_API + 'v1/admin/PlanDel', data: data }) +} //号源批量更新 export const PlanBatchUpdatePlanType = (data = {}) => { return axios({ url: import.meta.env.VITE_APP_API + 'v1/admin/PlanBatchUpdatePlanType', data: data }) diff --git a/admin/src/views/PlanMngr/Plan.vue b/admin/src/views/PlanMngr/Plan.vue index 0301ca6..b578c6d 100644 --- a/admin/src/views/PlanMngr/Plan.vue +++ b/admin/src/views/PlanMngr/Plan.vue @@ -105,7 +105,12 @@ ElMessageBox } from 'element-plus' import { - PlanGetList,PlanGetDetail,CheckUpTypeGetEnableList,PlanSave,PlanBatchUpdatePlanType + PlanGetList, + PlanGetDetail, + CheckUpTypeGetEnableList, + PlanSave, + PlanBatchUpdatePlanType, + PlanDel } from '@/api/api.js' let loading = ref(false) let searchInfo = ref({}) @@ -215,6 +220,36 @@ BatchUpdateFunc(type) } + } + const Del=()=>{ + ElMessageBox.confirm( + '确认删除所选号源吗(已被占用号源不会删除)?', + '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'error', + } + ) + .then(() => { + loading.value = true + let selected_list=[] + list.value.forEach((v,i)=>{ + if(v.selected!=undefined && v.selected==true){ + selected_list.push(v.id) + } + }) + PlanDel({ + ids: selected_list + }).then(res => { + loading.value = false + if (res.status) { + GetList() + } else { + ElMessage.error(res.msg) + } + }) + }) + } const BatchUpdateFunc=(type,info=null)=>{ loading.value = true