|
...
|
...
|
@@ -9,6 +9,7 @@ |
|
|
|
|
|
|
|
namespace App\Http\Logic\Aside\Ticket;
|
|
|
|
|
|
|
|
use App\Enums\Common\Code;
|
|
|
|
use App\Helper\Arr;
|
|
|
|
use App\Http\Logic\Aside\BaseLogic;
|
|
|
|
use App\Models\Blog\Blog;
|
|
...
|
...
|
@@ -25,6 +26,7 @@ use App\Models\RouteMap\RouteMap; |
|
|
|
use App\Models\Ticket\TicketUploadData;
|
|
|
|
use App\Services\ProjectServer;
|
|
|
|
use Illuminate\Support\Facades\DB;
|
|
|
|
use Illuminate\Support\Facades\Http;
|
|
|
|
|
|
|
|
class TicketUploadDataLogic extends BaseLogic
|
|
|
|
{
|
|
...
|
...
|
@@ -47,6 +49,9 @@ class TicketUploadDataLogic extends BaseLogic |
|
|
|
$this->map['text'] = ['like','%'.$this->map['text'].'%'];
|
|
|
|
}
|
|
|
|
ProjectServer::useProject($map['project_id']);
|
|
|
|
if(empty($map['type'])){
|
|
|
|
$map['type'] = $this->model::TYPE_SIX;//6.0数据
|
|
|
|
}
|
|
|
|
$data = $this->model->lists($map,$page,$row,$order);
|
|
|
|
if(!empty($data) && !empty($data['list'])){
|
|
|
|
foreach ($data['list'] as &$v){
|
|
...
|
...
|
@@ -154,22 +159,64 @@ class TicketUploadDataLogic extends BaseLogic |
|
|
|
if($info === false){
|
|
|
|
$this->fail('当前数据不存在或已被删除');
|
|
|
|
}
|
|
|
|
if($info['project_type'] == $this->model::TYPE_SIX){//6.0数据
|
|
|
|
//审核成功执行
|
|
|
|
if($this->param['status'] == 1){
|
|
|
|
if($this->param['status'] == $this->model::STATUS_SUCCESS){
|
|
|
|
ProjectServer::useProject($info['project_id']);
|
|
|
|
if($info['type'] == 1){
|
|
|
|
if($info['type'] == $this->model::TYPE_PRODUCT){
|
|
|
|
$this->saveProductData($info);
|
|
|
|
}elseif ($info['type'] == 2){
|
|
|
|
}elseif ($info['type'] == $this->model::TYPE_BLOG){
|
|
|
|
$this->saveBlogData($info);
|
|
|
|
}else{
|
|
|
|
$this->saveNewsData($info);
|
|
|
|
}
|
|
|
|
DB::disconnect('custom_mysql');
|
|
|
|
}
|
|
|
|
}else{
|
|
|
|
if($this->param['status'] == $this->model::STATUS_SUCCESS){
|
|
|
|
if($info['type'] == $this->model::TYPE_PRODUCT){
|
|
|
|
$this->save5ProductData($info);
|
|
|
|
}else{
|
|
|
|
$this->save5NewsData($info);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$data = $this->model->edit(['status'=>$this->param['status'],'operator_id'=>$this->manager['id'],'remark'=>$this->param['remark'] ?? ''],['id'=>$this->param['id']]);
|
|
|
|
return $this->success($data);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :保存5.0产品数据
|
|
|
|
* @name :save5ProductData
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2025/11/10 14:18
|
|
|
|
*/
|
|
|
|
public function save5ProductData($info){
|
|
|
|
$projectInfo['website'] = 'https://devmark.globalso.com/';
|
|
|
|
$action = $this->model->saveAction($this->param['type']);
|
|
|
|
$url = $projectInfo['website'].'wp-admin/admin-ajax.php?action='.$action;
|
|
|
|
if(empty($action)){
|
|
|
|
$this->response('未知请求',Code::SYSTEM_ERROR);
|
|
|
|
}
|
|
|
|
$response = Http::withHeaders([])->asForm()->post($url, [
|
|
|
|
'name' => $this->param['name'],
|
|
|
|
'parent' => $this->param['parent'] ?? 0,
|
|
|
|
]);
|
|
|
|
return $this->success();
|
|
|
|
}
|
|
|
|
|
|
|
|
public function save5NewsData($info){
|
|
|
|
return $this->success();
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :设置排序
|
|
|
|
* @name :setProductSort
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2025/11/10 14:11
|
|
|
|
*/
|
|
|
|
public function setProductSort($mdoel){
|
|
|
|
$info = $mdoel->orderBy('sort','desc')->first();
|
|
|
|
if(empty($info)){
|
...
|
...
|
|