|
...
|
...
|
@@ -27,37 +27,6 @@ class ProductLogic extends BaseLogic |
|
|
|
$this->model = new Product();
|
|
|
|
}
|
|
|
|
|
|
|
|
// public function getList(array $map = [], array $sort = ['id' => 'desc'], array $columns = ['*'], int $row = 20)
|
|
|
|
// {
|
|
|
|
// $data = parent::getList($map, $sort, $columns, $row);
|
|
|
|
// foreach ($data['list'] as &$v){
|
|
|
|
// $v = $this->formatData($v);
|
|
|
|
// }
|
|
|
|
// return $this->success($data);
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// public function getInfo($id)
|
|
|
|
// {
|
|
|
|
// $info = $this->model->read(['id'=>$id]);
|
|
|
|
// $info = $this->formatData($info);
|
|
|
|
// return $this->success($info);
|
|
|
|
// }
|
|
|
|
|
|
|
|
// public function formatData($info){
|
|
|
|
// foreach ($info['category_id'] as $category_id) {
|
|
|
|
// $info['category_id_text'][] = (new CategoryLogic())->getCacheInfo($category_id)['title'] ?? '';
|
|
|
|
// }
|
|
|
|
// foreach ($info['keyword_id'] as $keyword_id){
|
|
|
|
// $info['keyword_id_text'][] =(new KeywordLogic())->getCacheInfo($keyword_id)['title']??'';
|
|
|
|
// }
|
|
|
|
// $info['category_id_text'] = Arr::arrToSet($info['category_id_text'], 'trim');
|
|
|
|
// $info['keyword_id_text'] = Arr::arrToSet($info['keyword_id_text'], 'trim');
|
|
|
|
// $info['status_text'] = Product::statusMap()[$info['status']] ?? '';
|
|
|
|
// $info['created_uid_text'] = (new UserLogic())->getCacheInfo($info['created_uid'])['name'] ?? '';
|
|
|
|
// $info['url'] = $this->user['domain'] . $info['route'] ;
|
|
|
|
// return $info;
|
|
|
|
// }
|
|
|
|
|
|
|
|
public function save($param){
|
|
|
|
//封面取第一个图片
|
|
|
|
$param['thumb'] = $param['gallery'][0] ?? '';
|
...
|
...
|
|