|
...
|
...
|
@@ -17,6 +17,7 @@ use App\Models\Product\ExtendInfo; |
|
|
|
use App\Models\Product\Keyword;
|
|
|
|
use App\Models\Product\KeywordRelated;
|
|
|
|
use App\Models\Product\Product;
|
|
|
|
use App\Models\Product\ProductType;
|
|
|
|
use App\Models\RouteMap\RouteMap;
|
|
|
|
use App\Models\Template\Setting;
|
|
|
|
use App\Models\Template\BTemplate;
|
|
...
|
...
|
@@ -665,4 +666,41 @@ class ProductController extends BaseController |
|
|
|
$logic->delProductKeyword();
|
|
|
|
$this->response('success');
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :获取产品类型
|
|
|
|
* @name :getProductType
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2024/8/21 17:18
|
|
|
|
*/
|
|
|
|
public function getProductType(){
|
|
|
|
$typeModel = new ProductType();
|
|
|
|
$data = $typeModel->list(['project_id'=>['in',[0,$this->user['project_id']]]]);
|
|
|
|
$this->response('success',Code::SUCCESS,$data);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :保存数据
|
|
|
|
* @name :saveType
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2024/8/21 17:52
|
|
|
|
*/
|
|
|
|
public function saveType(){
|
|
|
|
$this->request->validate([
|
|
|
|
'name'=>'required',
|
|
|
|
],[
|
|
|
|
'name.required' => 'id不为空',
|
|
|
|
]);
|
|
|
|
$typeModel = new ProductType();
|
|
|
|
if(isset($this->param['id']) && !empty($this->param['id'])){
|
|
|
|
$id = $this->param['id'];
|
|
|
|
$typeModel->edit($this->param,['id'=>$this->param['id']]);
|
|
|
|
}else{
|
|
|
|
$this->param['project_id'] = $this->user['project_id'];
|
|
|
|
$id = $typeModel->addReturnId($this->param);
|
|
|
|
}
|
|
|
|
$this->response('success',Code::SUCCESS,['id'=>$id]);
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|