Merge branch 'master' of http://47.244.231.31:8099/zhl/globalso-v6
正在显示
3 个修改的文件
包含
5 行增加
和
2 行删除
| @@ -50,7 +50,7 @@ class UpdateProductCategory extends Command | @@ -50,7 +50,7 @@ class UpdateProductCategory extends Command | ||
| 50 | public function handle(){ | 50 | public function handle(){ |
| 51 | //获取所有项目 | 51 | //获取所有项目 |
| 52 | $projectModel = new Project(); | 52 | $projectModel = new Project(); |
| 53 | - $list = $projectModel->list(['id'=>['in',[1077]]],'id',['id']); | 53 | + $list = $projectModel->list(['id'=>['in',[1515]]],'id',['id']); |
| 54 | echo date('Y-m-d H:i:s') . ' start: ' . json_encode($list) . PHP_EOL; | 54 | echo date('Y-m-d H:i:s') . ' start: ' . json_encode($list) . PHP_EOL; |
| 55 | try { | 55 | try { |
| 56 | foreach ($list as $v) { | 56 | foreach ($list as $v) { |
| @@ -688,7 +688,7 @@ class ProjectUpdate extends Command | @@ -688,7 +688,7 @@ class ProjectUpdate extends Command | ||
| 688 | 'name' => $item['title'], | 688 | 'name' => $item['title'], |
| 689 | 'category_id' => $category_id, | 689 | 'category_id' => $category_id, |
| 690 | 'content' => $item['content'] ?? '', | 690 | 'content' => $item['content'] ?? '', |
| 691 | - 'sort' => $item['sort'] ?? 0, | 691 | + 'sort' => $sort, |
| 692 | 'release_at' => $item['post_time'] ?? date('Y-m-d H:i:s'), | 692 | 'release_at' => $item['post_time'] ?? date('Y-m-d H:i:s'), |
| 693 | 'image' => $new_img | 693 | 'image' => $new_img |
| 694 | ], ['id' => $id]); | 694 | ], ['id' => $id]); |
| @@ -362,6 +362,7 @@ class ProductLogic extends BaseLogic | @@ -362,6 +362,7 @@ class ProductLogic extends BaseLogic | ||
| 362 | public function productDelete(){ | 362 | public function productDelete(){ |
| 363 | DB::connection('custom_mysql')->beginTransaction(); | 363 | DB::connection('custom_mysql')->beginTransaction(); |
| 364 | try { | 364 | try { |
| 365 | + $cateRelate = new CategoryRelated(); | ||
| 365 | foreach ($this->param['ids'] as $id) { | 366 | foreach ($this->param['ids'] as $id) { |
| 366 | $info = $this->model->read(['id'=>$id],['id','status']); | 367 | $info = $this->model->read(['id'=>$id],['id','status']); |
| 367 | if($info['status'] == Product::STATUS_RECYCLE){ | 368 | if($info['status'] == Product::STATUS_RECYCLE){ |
| @@ -369,6 +370,8 @@ class ProductLogic extends BaseLogic | @@ -369,6 +370,8 @@ class ProductLogic extends BaseLogic | ||
| 369 | //删除当前产品模版 | 370 | //删除当前产品模版 |
| 370 | $this->delProductModule($id); | 371 | $this->delProductModule($id); |
| 371 | $this->model->del(['id'=>$id]); | 372 | $this->model->del(['id'=>$id]); |
| 373 | + //删除关联表 | ||
| 374 | + $cateRelate->del(['product_id'=>$id]); | ||
| 372 | }else{ | 375 | }else{ |
| 373 | //回收站 | 376 | //回收站 |
| 374 | $this->model->edit(['status'=>Product::STATUS_RECYCLE],['id'=>$id]); | 377 | $this->model->edit(['status'=>Product::STATUS_RECYCLE],['id'=>$id]); |
-
请 注册 或 登录 后发表评论