|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* @remark :
|
|
|
|
* @name :ExtendController.php
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/11/9 14:22
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace App\Http\Controllers\Bside\Product;
|
|
|
|
|
|
|
|
use App\Enums\Common\Code;
|
|
|
|
use App\Http\Controllers\Bside\BaseController;
|
|
|
|
use App\Http\Logic\Bside\Product\ExtendLogic;
|
|
|
|
use App\Models\Product\Extend;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :添加扩展字段
|
|
|
|
* @name :ExtendController
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/11/9 14:22
|
|
|
|
*/
|
|
|
|
class ExtendController extends BaseController
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @remark :获取所有扩展字段
|
|
|
|
* @name :lists
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/11/9 14:23
|
|
|
|
*/
|
|
|
|
public function lists(Extend $extend){
|
|
|
|
$lists = $extend->list($this->map);
|
|
|
|
$this->response('success',Code::SUCCESS,$lists);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :保存数据
|
|
|
|
* @name :save
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/11/9 14:26
|
|
|
|
*/
|
|
|
|
public function save(ExtendLogic $extendLogic){
|
|
|
|
$this->request->validate([
|
|
|
|
'title'=>'required',
|
|
|
|
'type'=>'required',
|
|
|
|
],[
|
|
|
|
'title.required' => '字段名称不能为空',
|
|
|
|
'type.required' => '字段类型不能为空',
|
|
|
|
]);
|
|
|
|
$extendLogic->extendSave();
|
|
|
|
$this->response('success');
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|