Commit c9ed0e82 authored by yinxiaoling's avatar yinxiaoling

策略删除

parent d6d9185a
......@@ -10,7 +10,7 @@ trait Tool
return ['user_name'=>'yxl001','user_sn'=>'SYSUSER|9da548a2e392a679eb274a0b2abeb627','parent_sn'=>'ljs'];
}
public function getAllowProjects($style=0){
$projectInfo = [['sn'=>'projects|a3a4259352c8e964ad6ea6c5ee8a7208','name'=>'liuy-转人工测试'],['sn'=>'projects|a3a4259352c8e964ad6ea6c5ee8a7208','name'=>'liuy-转人工测试']];
$projectInfo = [['sn'=>'projects|a3a4259352c8e964ad6ea6c5ee8a7208','name'=>'liuy-转人工测试'],['sn'=>'projects|17a71649f886bce050d637e86a3c85e8','name'=>'小贷-测试林俊生']];
if ($style == 1){
$projectArr = [];
foreach ($projectInfo as $k=>$v){
......
......@@ -10,6 +10,9 @@ use App\Http\Controllers\Tool;
use App\Service\StrategyService;
use App\Models\StrategySet;
use Illuminate\Support\Facades\Log;
use App\Models\StrategyExcel;
use App\Models\StrategyTask;
use Illuminate\Support\Facades\DB;
//use App\Http\Requests\StrategySetCreateRequest;
class StrategySetController extends Controller
......@@ -92,8 +95,14 @@ class StrategySetController extends Controller
return $this->successWithInfo(['data'=>$returnArr]);
}
//删除策略
public function destroy($id){
dd($id);
public function destroy($strategySn){
DB::transaction(function () use ($strategySn) {
// 删除逻辑 注意多表关联的情况
StrategySet::where('strategy_sn', $strategySn)->delete();
StrategyExcel::where('strategy_sn', $strategySn)->delete();
StrategyTask::where('strategy_sn', $strategySn)->delete();
});
return $this->successWithInfo('操作完成');
}
//项目列表
public function getProjectsList(){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment