作者 Your Name
... ... @@ -649,6 +649,14 @@ class ProjectUpdate extends Command
$new_img = $this->source_download($image, $project_id, $domain_arr['host'], $web_url_domain, $home_url);
//名称去掉特殊符号
$item['title'] = $this->special2str($item['title'] ?? '');
//排序
$sort = 0;
if(isset($item['listorder'])){
$sort = $item['listorder'];
}
if(isset($item['sort'])){
$sort = $item['sort'];
}
try {
$custom_content = $model->read(['route' => $route], ['id','six_read']);
... ... @@ -659,7 +667,7 @@ class ProjectUpdate extends Command
'module_id' => $custom_info['id'],
'category_id' => $category_id,
'content' => $item['content'] ?? '',
'sort' => $item['sort'] ?? 0,
'sort' => $sort,
'image' => $new_img,
'created_at' => $item['post_time'] ?? date('Y-m-d H:i:s'),
'updated_at' => $item['post_time'] ?? date('Y-m-d H:i:s'),
... ...
... ... @@ -154,11 +154,9 @@ class ProductController extends BaseController
if (isset($this->map['category_id']) && !empty($this->map['category_id'])) {
$str[] = $this->map['category_id'];
$this->getAllSub($this->map['category_id'],$str);
$query->where(function ($subQuery) use ($str) {
foreach ($str as $v) {
$subQuery->orWhereRaw("FIND_IN_SET(?, category_id) > 0", [$v]);
}
});
$categoryRelatedModel = new CategoryRelated();
$product_id_arr = $categoryRelatedModel->whereIn('cate_id',$str)->pluck('product_id')->toArray();
$query = $query->whereIn('id',$product_id_arr);
}
if(isset($this->map['title']) && !empty($this->map['title'])){
$query = $query->where('title','like','%'.$this->map['title'].'%');
... ...