dyjh 6 年之前
父节点
当前提交
81337367e0

+ 12 - 7
app/Http/Controllers/Admin/Album/CatController.php

xqd
@@ -91,22 +91,27 @@ class CatController extends Controller
     /**
      * 保存修改
      */
-    private function _createFirst(){
+    private function _createFirst()
+    {
         $data = (array) request('data');
-        $id = request('id');
+        $ids = request('id');
         $data['store_id'] = $this->getStoreId();
         if (!empty($data['pic_url'])) {
             $data['pic_url'] = $this->formatImgUrl($data['pic_url']);
         }
         $data['parent_id'] = 0;
         $id = $this->repository->create($data);
+        if ($ids == 0) {
+            $url = U('Album/Cat/create');
+        } else {
+            $url = U('Album/Cat/update', ['id' => $ids]);
+        }
         if ($id) {
-            $url[] = array('url' => U('Album/Cat/index'), 'title' => '返回列表');
-            $url[] = array('url' => U('Album/Cat/create'), 'title' => '继续添加');
-            $this->showMessage('添加成功', $url);
+            $urls[] = array('url' => $url, 'title' => '返回');
+            $this->showMessage('添加成功', $urls);
         } else {
-            $url[] = array('url' => U('Album/Cat/index'), 'title' => '返回列表');
-            return $this->showWarning('添加失败', $url);
+            $urls[] = array('url' => $url, 'title' => '返回列表');
+            return $this->showWarning('添加失败', $urls);
         }
     }
 

+ 1 - 1
app/Http/Controllers/Api/V1/AlbumPosterController.php

xqd
@@ -96,7 +96,7 @@ class AlbumPosterController extends Controller
         $datas['share'] = $WeChatApp->share_image;
         $datas['title'] = $WeChatApp->share_title;
         $datas['qrcode'] = $this->createPoster($userAuth, $store_id);
-        return $this->api(compact('dates'));
+        return $this->api(compact('datas'));
     }
 
     /**