bug fix in commodity and add script part to api
This commit is contained in:
parent
1a6feea31a
commit
ea899a2022
|
@ -184,6 +184,7 @@ class AdminController extends AbstractController
|
||||||
$resp = [];
|
$resp = [];
|
||||||
$resp['keywords'] = $item->getSiteKeywords();
|
$resp['keywords'] = $item->getSiteKeywords();
|
||||||
$resp['description'] = $item->getDiscription();
|
$resp['description'] = $item->getDiscription();
|
||||||
|
$resp['scripts'] = $item->getScripts();
|
||||||
return $this->json($resp);
|
return $this->json($resp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -198,6 +199,7 @@ class AdminController extends AbstractController
|
||||||
$item = $entityManager->getRepository(Settings::class)->findAll()[0];
|
$item = $entityManager->getRepository(Settings::class)->findAll()[0];
|
||||||
$item->setSiteKeywords($params['keywords']);
|
$item->setSiteKeywords($params['keywords']);
|
||||||
$item->setDiscription($params['description']);
|
$item->setDiscription($params['description']);
|
||||||
|
$item->setScripts($params['scripts']);
|
||||||
$entityManager->persist($item);
|
$entityManager->persist($item);
|
||||||
$entityManager->flush();
|
$entityManager->flush();
|
||||||
return $this->json(['result' => 1]);
|
return $this->json(['result' => 1]);
|
||||||
|
|
|
@ -153,7 +153,7 @@ class CommodityController extends AbstractController
|
||||||
$data->setOrderPoint($params['orderPoint']);
|
$data->setOrderPoint($params['orderPoint']);
|
||||||
//set cat
|
//set cat
|
||||||
if(array_key_exists('cat',$params)){
|
if(array_key_exists('cat',$params)){
|
||||||
if($params['cat'] != null){
|
if($params['cat'] != ''){
|
||||||
$cat = $entityManager->getRepository(CommodityCat::class)->find($params['cat']);
|
$cat = $entityManager->getRepository(CommodityCat::class)->find($params['cat']);
|
||||||
if($cat){
|
if($cat){
|
||||||
if($cat->getBid() == $acc['bid']){
|
if($cat->getBid() == $acc['bid']){
|
||||||
|
|
|
@ -41,6 +41,9 @@ class Settings
|
||||||
#[ORM\Column(length: 255, nullable: true)]
|
#[ORM\Column(length: 255, nullable: true)]
|
||||||
private ?string $discription = null;
|
private ?string $discription = null;
|
||||||
|
|
||||||
|
#[ORM\Column(type: Types::TEXT, nullable: true)]
|
||||||
|
private ?string $scripts = null;
|
||||||
|
|
||||||
public function getId(): ?int
|
public function getId(): ?int
|
||||||
{
|
{
|
||||||
return $this->id;
|
return $this->id;
|
||||||
|
@ -153,4 +156,16 @@ class Settings
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getScripts(): ?string
|
||||||
|
{
|
||||||
|
return $this->scripts;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setScripts(?string $scripts): static
|
||||||
|
{
|
||||||
|
$this->scripts = $scripts;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -285,5 +285,6 @@
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
<script src="{{ asset("assets/js/dashmix.app.min.js") }}"></script>
|
<script src="{{ asset("assets/js/dashmix.app.min.js") }}"></script>
|
||||||
|
{{ settings.scripts | raw }}
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Reference in a new issue