|
@@ -71,6 +71,7 @@ class StatTreeController extends Controller
|
|
|
$rows = json_decode($data, true);
|
|
|
|
|
|
$statTree = StatTree::where('id', $statTreeID)->first();
|
|
|
+ $model = $statTree->model;
|
|
|
DB::beginTransaction();
|
|
|
DB::statement("DELETE FROM stat_tree_line WHERE stat_tree_id = :stat_tree_id", ['stat_tree_id' => $statTree->id]);
|
|
|
|
|
@@ -92,7 +93,7 @@ class StatTreeController extends Controller
|
|
|
$cell = $row[$i];
|
|
|
if(!$cell || empty($cell)) continue;
|
|
|
|
|
|
- $clause = Clause::where('label', $cell)->first();
|
|
|
+ $clause = Clause::where('label', $cell)->where('model', 'ilike', $model)->first();
|
|
|
if(!$clause){
|
|
|
DB::rollBack();
|
|
|
return $this->fail('No clause record found!');
|