作者 李宇航

合并分支 'lyh-server' 到 'master'

Lyh server



查看合并请求 !2883
... ... @@ -88,7 +88,7 @@ class TicketUploadDataController extends BaseController
* @method :post
* @time :2025/9/29 17:18
*/
public function cateText($type,$category_id,$is_array = false)
public function cateText($type,$category_id,$keyword_id = [],$is_array = false)
{
if(empty($category_id)){
return '';
... ... @@ -108,7 +108,7 @@ class TicketUploadDataController extends BaseController
->pluck($filed, 'id')
->toArray();
if($type == 1){
$keywod_arr = $keywodModel->whereIn('id', (array)$category_id)
$keywod_arr = $keywodModel->whereIn('id', (array)$keyword_id)
->pluck($filed, 'id')
->toArray();
return ['keywod_arr' => $keywod_arr, 'cate_arr' => $cate_arr];
... ... @@ -141,7 +141,7 @@ class TicketUploadDataController extends BaseController
$this->response('当前数据不存在或已被删除',Code::SYSTEM_ERROR);
}
ProjectServer::useProject($info['project_id']);
$info['text']['cate_name'] = $this->cateText($info['type'],$info['text']['category_id'] ?? [],true);
$info['text']['cate_name'] = $this->cateText($info['type'],$info['text']['category_id'] ?? [],$info['text']['keyword_id'] ?? [],true);
$info = $this->getHandleFileImage($info);
DB::disconnect('custom_mysql');
$this->response('success', Code::SUCCESS, $info);
... ...
... ... @@ -85,7 +85,7 @@ class TicketUploadDataLogic extends BaseLogic
* @method :post
* @time :2025/9/29 17:18
*/
public function cateText($type,$category_id,$is_array = false)
public function cateText($type,$category_id = [],$keyword_id = [],$is_array = false)
{
if(empty($category_id)){
return '';
... ... @@ -105,7 +105,7 @@ class TicketUploadDataLogic extends BaseLogic
->pluck($filed, 'id')
->toArray();
if($type == 1){
$keywod_arr = $keywodModel->whereIn('id', (array)$category_id)
$keywod_arr = $keywodModel->whereIn('id', (array)$keyword_id)
->pluck($filed, 'id')
->toArray();
return ['keywod_arr' => $keywod_arr, 'cate_arr' => $cate_arr];
... ... @@ -131,7 +131,7 @@ class TicketUploadDataLogic extends BaseLogic
$this->fail('当前数据不存在或已被删除');
}
ProjectServer::useProject($info['project_id']);
$info['text']['cate_name'] = $this->cateText($info['type'],$info['text']['category_id'] ?? [],true);
$info['text']['cate_name'] = $this->cateText($info['type'],$info['text']['category_id'] ?? [],$info['text']['keyword_id'] ?? [],true);
$info = $this->getHandleFileImage($info);
DB::disconnect('custom_mysql');
return $this->success($info);
... ... @@ -186,17 +186,18 @@ class TicketUploadDataLogic extends BaseLogic
$v['url'] = str_replace_url($v['url']);
$info['text']['image'][$k] = $v;
}
$thumb = Arr::a2s($info['text']['image'][0] ?? []);
$info['text']['image'] = Arr::a2s($info['text']['image'] ?? []);
}else{
$info['text']['image'] = Arr::a2s([]);
$thumb = $info['text']['image'] = Arr::a2s([]);
}
try {
$productModel = new Product();
$data = [
'project_id' => $info['project_id'],
'title' => $info['text']['title'],
'thumb'=>json_encode($info['text']['image'][0] ?? [],true),
'gallery'=>json_encode($info['text']['image'] ?? [],true),
'thumb'=>$thumb,
'gallery'=>$info['text']['image'] ?? [],
'intro'=>$info['text']['remark'],
'category_id'=>$category_id ?? '',
'keyword_id'=>$keyword_id ?? '',
... ...