正在显示
2 个修改的文件
包含
6 行增加
和
2 行删除
| @@ -38,7 +38,7 @@ class ProductController extends BaseController | @@ -38,7 +38,7 @@ class ProductController extends BaseController | ||
| 38 | $map[] = ['status', $this->param['status']]; | 38 | $map[] = ['status', $this->param['status']]; |
| 39 | } | 39 | } |
| 40 | $sort = ['id' => 'desc']; | 40 | $sort = ['id' => 'desc']; |
| 41 | - $data = $logic->getList($map, $sort, ['id', 'title', 'thumb', 'category_id', 'keywords', 'status', 'created_at', 'updated_at']); | 41 | + $data = $logic->getList($map, $sort, ['id', 'title', 'thumb', 'category_id', 'keywords', 'status', 'created_uid', 'created_at', 'updated_at']); |
| 42 | return $this->success($data); | 42 | return $this->success($data); |
| 43 | } | 43 | } |
| 44 | 44 | ||
| @@ -50,7 +50,7 @@ class ProductController extends BaseController | @@ -50,7 +50,7 @@ class ProductController extends BaseController | ||
| 50 | ]); | 50 | ]); |
| 51 | $data = $logic->getInfo($this->param['id']); | 51 | $data = $logic->getInfo($this->param['id']); |
| 52 | return $this->success(Arr::twoKeepKeys($data, ['id', 'title', 'gallery', 'attrs', 'category_id', 'keywords', 'intro', 'content', | 52 | return $this->success(Arr::twoKeepKeys($data, ['id', 'title', 'gallery', 'attrs', 'category_id', 'keywords', 'intro', 'content', |
| 53 | - 'describe', 'seo_mate', 'related_product_id', 'status', 'category_id_text'])); | 53 | + 'describe', 'seo_mate', 'related_product_id', 'status', 'category_id_text', 'status_text', 'created_uid', 'created_uid_text'])); |
| 54 | } | 54 | } |
| 55 | 55 | ||
| 56 | public function save(ProductRequest $request, ProductLogic $logic) | 56 | public function save(ProductRequest $request, ProductLogic $logic) |
| @@ -4,6 +4,7 @@ namespace App\Http\Logic\Bside\Product; | @@ -4,6 +4,7 @@ namespace App\Http\Logic\Bside\Product; | ||
| 4 | 4 | ||
| 5 | use App\Helper\Arr; | 5 | use App\Helper\Arr; |
| 6 | use App\Http\Logic\Bside\BaseLogic; | 6 | use App\Http\Logic\Bside\BaseLogic; |
| 7 | +use App\Http\Logic\Bside\User\UserLogic; | ||
| 7 | use App\Models\Product\CategoryRelated; | 8 | use App\Models\Product\CategoryRelated; |
| 8 | use App\Models\Product\Product; | 9 | use App\Models\Product\Product; |
| 9 | use App\Models\RouteMap; | 10 | use App\Models\RouteMap; |
| @@ -33,6 +34,7 @@ class ProductLogic extends BaseLogic | @@ -33,6 +34,7 @@ class ProductLogic extends BaseLogic | ||
| 33 | } | 34 | } |
| 34 | $v['category_id_text'] = Arr::arrToSet($v['category_id_text'], 'trim'); | 35 | $v['category_id_text'] = Arr::arrToSet($v['category_id_text'], 'trim'); |
| 35 | $v['status_text'] = Product::statusMap()[$v['status']] ?? ''; | 36 | $v['status_text'] = Product::statusMap()[$v['status']] ?? ''; |
| 37 | + $v['created_uid_text'] = (new UserLogic())->getCacheInfo($v['created_uid'])['name'] ?? ''; | ||
| 36 | } | 38 | } |
| 37 | return $this->success($data); | 39 | return $this->success($data); |
| 38 | } | 40 | } |
| @@ -45,6 +47,7 @@ class ProductLogic extends BaseLogic | @@ -45,6 +47,7 @@ class ProductLogic extends BaseLogic | ||
| 45 | } | 47 | } |
| 46 | $info['category_id_text'] = Arr::arrToSet($info['category_id_text'], 'trim'); | 48 | $info['category_id_text'] = Arr::arrToSet($info['category_id_text'], 'trim'); |
| 47 | $info['status_text'] = Product::statusMap()[$info['status']] ?? ''; | 49 | $info['status_text'] = Product::statusMap()[$info['status']] ?? ''; |
| 50 | + $info['created_uid_text'] = (new UserLogic())->getCacheInfo($info['created_uid'])['name'] ?? ''; | ||
| 48 | return $this->success($info); | 51 | return $this->success($info); |
| 49 | } | 52 | } |
| 50 | 53 | ||
| @@ -55,6 +58,7 @@ class ProductLogic extends BaseLogic | @@ -55,6 +58,7 @@ class ProductLogic extends BaseLogic | ||
| 55 | try { | 58 | try { |
| 56 | $data = $param; | 59 | $data = $param; |
| 57 | unset($data['route']); | 60 | unset($data['route']); |
| 61 | + $data['created_uid'] = $this->user['id']; | ||
| 58 | $res = parent::save($data); | 62 | $res = parent::save($data); |
| 59 | //关联分类 | 63 | //关联分类 |
| 60 | CategoryRelated::saveRelated($res['id'], $data['category_id']); | 64 | CategoryRelated::saveRelated($res['id'], $data['category_id']); |
-
请 注册 或 登录 后发表评论