dyjh há 6 anos atrás
pai
commit
b08e134b1b

+ 1 - 0
app/Http/Controllers/Admin/Album/PosterController.php

xqd
@@ -59,6 +59,7 @@ class PosterController extends Controller
         }
         $id = request('id');
         if (empty($id)) {
+            $data['store_id'] = $this->getStoreId();
             $ok = $this->repository->create($data);
         } else {
             $ok = $this->repository->update($id, $data);

+ 5 - 4
app/Http/Controllers/Api/V1/AlbumPosterController.php

xqd
@@ -108,22 +108,23 @@ class AlbumPosterController extends Controller
 
     public function createPoster(Request $request)
     {
-       /* $userAuth = Auth('api')->user();
+        $userAuth = Auth('api')->user();
         if (!$userAuth) {
             return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '未登录!');
         }
         $validator = Validator::make($request->all(), [
             'store_id' => 'required',
+            'store_id' => 'required',
         ], [
             'store_id.required' => '店铺信息未知',
         ]);
         if ($validator->fails()) {
             return $this->validatorError($validator->messages()->all(), ErrorCode::CLIENT_WRONG_PARAMS, '');
         }
-        $store_id = $request->input('store_id');*/
+        $data = $request->input('store_id');
         $editor = Grafika::createEditor();
-        $editor->open($image, public_path() . '/base/poster/img/poster_canvas.png');
-
+        $editor->open($image_poster, public_path() . '/base/poster/img/poster_canvas.png');
+        $editor->open($image_poduct, public_path() . '');
     }
 
     private function curlGet($url)