Index.php 1010 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace app\shop\controller\decoration;
  3. use app\common\basics\ShopBase;
  4. use app\shop\logic\decoration\IndexLogic;
  5. use app\common\server\JsonServer;
  6. class Index extends ShopBase
  7. {
  8. public function set()
  9. {
  10. if($this->request->isAjax()) {
  11. $post = $this->request->post();
  12. $post['shop_id'] = $this->shop_id;
  13. if(!isset($post['logo']) || !isset($post['background'])) {
  14. return JsonServer::error('商家logo或背景图不能空');
  15. }
  16. if(!isset($post['pc_cover'])) {
  17. return JsonServer::error('PC端店铺封面不能空');
  18. }
  19. $result = IndexLogic::set($post);
  20. if($result === true) {
  21. return JsonServer::success('设置成功');
  22. }
  23. return JsonServer::error(IndexLogic::getError());
  24. }
  25. $shopSet = IndexLogic::getShopSet($this->shop_id);
  26. return view('', [
  27. 'shopSet' => $shopSet
  28. ]);
  29. }
  30. }