作者 lyh

gx

... ... @@ -4,4 +4,4 @@
<center><h1>404 Not Found</h1></center>
<hr><center>nginx</center>
</body>
</html>
\ No newline at end of file
</html>
... ...
... ... @@ -62,26 +62,6 @@ class ProductLogic extends BaseLogic
}
/**
* @remark :编辑产品
* @name :editProduct
* @author :lyh
* @method :post
* @time :2023/9/7 10:02
*/
public function editProductRoute($id,$route){
$info = $this->model->read(['id'=>$this->param['id']]);
if($info['route'] != $route){
//生成一条删除路由记录
$data = [
'source'=>RouteMap::SOURCE_PRODUCT,
'route'=>$route,
];
$this->setRouteDeleteSave($data);
}
return $id;
}
/**
* @remark :不使用save处理参数
* @name :handleSaveParam
* @author :lyh
... ... @@ -89,6 +69,7 @@ class ProductLogic extends BaseLogic
* @time :2023/8/21 17:03
*/
public function handleSaveParam(&$param){
//产品图
if(isset($param['gallery']) && !empty($param['gallery'])){
foreach ($param['gallery'] as $k => $v){
$v['url'] = str_replace_url($v['url']);
... ... @@ -97,14 +78,30 @@ class ProductLogic extends BaseLogic
$param['thumb'] = Arr::a2s($param['gallery'][0] ?? '');
$param['gallery'] = Arr::a2s($param['gallery'] ?? '');
}
$param['attrs'] = Arr::a2s($param['attrs'] ?? '');
$param['attr_id'] = Arr::arrToSet($param['attr_id'] ?? '');
$param['category_id'] = ','.Arr::arrToSet($param['category_id']).',';
$param['keyword_id'] = ','.Arr::arrToSet($param['keyword_id']).',';
$param['describe'] = Arr::a2s($param['describe'] ?? '');
$param['describe_id'] = Arr::arrToSet($param['describe_id'] ?? '');
$param['seo_mate'] = Arr::a2s($param['seo_mate'] ?? '');
$param['related_product_id'] = Arr::arrToSet($param['related_product_id'] ?? '');
if(isset($param['attrs']) && !empty($param['attrs'])){
$param['attrs'] = Arr::a2s($param['attrs'] ?? '');
}
if(isset($param['attr_id']) && !empty($param['attr_id'])){
$param['attr_id'] = Arr::arrToSet($param['attr_id'] ?? '');
}
if(isset($param['category_id']) && !empty($param['category_id'])){
$param['category_id'] = ','.Arr::arrToSet($param['category_id']).',';
}
if(isset($param['keyword_id']) && !empty($param['keyword_id'])){
$param['keyword_id'] = ','.Arr::arrToSet($param['keyword_id']).',';
}
if(isset($param['describe']) && !empty($param['describe'])){
$param['describe'] = Arr::a2s($param['describe'] ?? '');
}
if(isset($param['describe_id']) && !empty($param['describe_id'])){
$param['describe_id'] = Arr::arrToSet($param['describe_id'] ?? '');
}
if(isset($param['seo_mate']) && !empty($param['seo_mate'])){
$param['seo_mate'] = Arr::a2s($param['seo_mate'] ?? '');
}
if(isset($param['related_product_id']) && !empty($param['related_product_id'])){
$param['related_product_id'] = Arr::arrToSet($param['related_product_id'] ?? '');
}
if(isset($param['icon']) && !empty($param['icon'])){
foreach ($param['icon'] as $k1 => $v1){
$param['icon'][$k1] = str_replace_url($v1);
... ... @@ -115,6 +112,25 @@ class ProductLogic extends BaseLogic
return $param;
}
/**
* @remark :编辑产品
* @name :editProduct
* @author :lyh
* @method :post
* @time :2023/9/7 10:02
*/
public function editProductRoute($id,$route){
$info = $this->model->read(['id'=>$this->param['id']]);
if($info['route'] != $route){
//生成一条删除路由记录
$data = [
'source'=>RouteMap::SOURCE_PRODUCT,
'route'=>$route,
];
$this->setRouteDeleteSave($data);
}
return $id;
}
/**
* @remark :删除数据
... ...
... ... @@ -22,4 +22,5 @@ use App\Models\Base;
class AreaTimezone extends Base
{
protected $table = 'gl_area_timezone';
}
... ...