|
...
|
...
|
@@ -197,9 +197,7 @@ class ProductLogic extends BaseLogic |
|
|
|
* @time :2023/7/29 15:03
|
|
|
|
*/
|
|
|
|
public function setCopyProduct(){
|
|
|
|
$info = Product::withoutCasts()->find($this->param['id']);
|
|
|
|
var_dump($info);
|
|
|
|
die();
|
|
|
|
$info = $this->model->read(['id'=>$this->param['id']]);
|
|
|
|
$param = $this->setProductParams($info);
|
|
|
|
$save_id = $this->model->insertGetId($param);
|
|
|
|
$route = RouteMap::setRoute($param['route'], RouteMap::SOURCE_PRODUCT, $save_id, $this->user['project_id']);
|
|
...
|
...
|
@@ -288,14 +286,20 @@ class ProductLogic extends BaseLogic |
|
|
|
'created_at'=>date('Y-m-d H:i:s'),
|
|
|
|
'updated_at'=>date('Y-m-d H:i:s'),
|
|
|
|
];
|
|
|
|
if(!empty($info['thumb'])){
|
|
|
|
$param['thumb']= Arr::a2s($info['thumb']);
|
|
|
|
}
|
|
|
|
if(!empty($info['gallery'])){
|
|
|
|
$param['gallery']= Arr::a2s($info['gallery']);
|
|
|
|
if(isset($param['icon']) && !empty($param['icon'])){
|
|
|
|
foreach ($param['icon'] as $k1 => $v1){
|
|
|
|
$param['icon'][$k1] = str_replace_url($v1);
|
|
|
|
}
|
|
|
|
$param['icon'] = Arr::a2s($param['icon'] ?? '');
|
|
|
|
}
|
|
|
|
if(!empty($info['icon'])){
|
|
|
|
$param['icon']= Arr::a2s($info['icon']);
|
|
|
|
//产品图
|
|
|
|
if(isset($param['gallery']) && !empty($param['gallery'])){
|
|
|
|
foreach ($param['gallery'] as $k => $v){
|
|
|
|
$v['url'] = str_replace_url($v['url']);
|
|
|
|
$param['gallery'][$k] = $v;
|
|
|
|
}
|
|
|
|
$param['thumb'] = Arr::a2s($param['gallery'][0] ?? '');
|
|
|
|
$param['gallery'] = Arr::a2s($param['gallery'] ?? '');
|
|
|
|
}
|
|
|
|
return $param;
|
|
|
|
}
|
...
|
...
|
|