dyjh 6 jaren geleden
bovenliggende
commit
f5e053339e
66 gewijzigde bestanden met toevoegingen van 2824 en 1203 verwijderingen
  1. 15 10
      app/Http/Controllers/Admin/Album/AgentController.php
  2. 42 0
      app/Http/Controllers/Admin/Album/CatController.php
  3. 111 2
      app/Http/Controllers/Admin/Album/ManufacturerController.php
  4. 123 18
      app/Http/Controllers/Admin/Album/PosterController.php
  5. 8 20
      app/Http/Controllers/Admin/Album/ProductController.php
  6. 43 56
      app/Http/Controllers/Admin/Album/UserController.php
  7. 2 8
      app/Http/Controllers/Admin/Base/PhotosController.php
  8. 194 117
      app/Http/Controllers/Admin/Base/UserController.php
  9. 12 34
      app/Http/Controllers/Api/V1/AlbumBossController.php
  10. 52 72
      app/Http/Controllers/Api/V1/AlbumController.php
  11. 182 110
      app/Http/Controllers/Api/V1/AlbumPosterController.php
  12. 53 53
      app/Http/Controllers/Api/V1/FurnitureController.php
  13. 31 0
      app/Http/Middleware/AuthenticateApi.php
  14. 14 2
      app/Repositories/Album/Criteria/AgentWhere.php
  15. 11 11
      app/Repositories/Album/Criteria/CatWhere.php
  16. 6 3
      app/Repositories/Album/Criteria/MultiWhere.php
  17. 52 0
      app/Repositories/Album/Criteria/PosterWhere.php
  18. 4 1
      app/Repositories/Album/Criteria/PriceWhere.php
  19. 5 6
      app/Repositories/Album/Criteria/ProductWhere.php
  20. 15 1
      app/Repositories/Album/UserRepository.php
  21. 33 0
      database/migrations/2019_05_20_094445_add_column_banners_to_album_poster.php
  22. 34 0
      database/migrations/2019_05_29_163555_add_columns_video_download_to_album_poster.php
  23. 33 0
      database/migrations/2019_05_29_172519_add_columns_title_to_album_poster.php
  24. 33 0
      database/migrations/2019_05_30_132301_drop_column_in_album_poster.php
  25. 34 0
      database/migrations/2019_05_30_132708_add_column_share_to_album_manufacturer.php
  26. 33 0
      database/migrations/2019_05_30_141921_add_type_column_in_album_poster.php
  27. 33 0
      database/migrations/2019_05_30_153526_drop_banner_column_in_album_poster.php
  28. 32 0
      database/migrations/2019_05_30_155851_add_qrcode_to_album_manufacturer.php
  29. 32 0
      database/migrations/2019_05_30_200039_drop_column_album_banner.php
  30. 34 0
      database/migrations/2019_05_31_095826_add_column_to_album_mancufacturer.php
  31. BIN
      public/base/img/poster.jpg
  32. BIN
      public/base/img/share.jpg
  33. 1 1
      resources/views/admin/album/agent/edit.blade.php
  34. 145 85
      resources/views/admin/album/agent/index.blade.php
  35. 2 30
      resources/views/admin/album/banner/edit.blade.php
  36. 0 2
      resources/views/admin/album/banner/index.blade.php
  37. 80 0
      resources/views/admin/album/cat/edit-first.blade.php
  38. 16 7
      resources/views/admin/album/cat/edit.blade.php
  39. 1 1
      resources/views/admin/album/cat/index.blade.php
  40. 159 0
      resources/views/admin/album/manufacturer/album-edit.blade.php
  41. 0 92
      resources/views/admin/album/manufacturer/check.blade.php
  42. 56 1
      resources/views/admin/album/manufacturer/edit-all.blade.php
  43. 40 11
      resources/views/admin/album/manufacturer/edit.blade.php
  44. 275 0
      resources/views/admin/album/manufacturer/furniture-platform.blade.php
  45. 3 98
      resources/views/admin/album/manufacturer/furniture-system.blade.php
  46. 8 11
      resources/views/admin/album/manufacturer/index.blade.php
  47. 359 0
      resources/views/admin/album/manufacturer/platform-edit.blade.php
  48. 38 31
      resources/views/admin/album/nav/edit.blade.php
  49. 2 1
      resources/views/admin/album/news/edit.blade.php
  50. 7 6
      resources/views/admin/album/news/index.blade.php
  51. 5 5
      resources/views/admin/album/order/index.blade.php
  52. 39 36
      resources/views/admin/album/poster/edit.blade.php
  53. 90 0
      resources/views/admin/album/poster/index.blade.php
  54. 17 9
      resources/views/admin/album/product/edit.blade.php
  55. 106 0
      resources/views/admin/album/user/album-index.blade.php
  56. 0 133
      resources/views/admin/album/user/edit.blade.php
  57. 28 18
      resources/views/admin/album/user/furniture-index.blade.php
  58. 11 9
      resources/views/admin/base/user/edit.blade.php
  59. 8 13
      resources/views/admin/base/user/index.blade.php
  60. 2 1
      resources/views/admin/furniture/goods/category/edit.blade.php
  61. 2 1
      resources/views/admin/furniture/goods/edit.blade.php
  62. 6 1
      resources/views/admin/furniture/newgoods/comment/index.blade.php
  63. 0 51
      resources/views/admin/furniture/newgoods/comment/view.blade.php
  64. 1 1
      resources/views/admin/furniture/newgoods/info/booking.blade.php
  65. 3 2
      resources/views/admin/furniture/newgoods/info/edit.blade.php
  66. 8 22
      resources/views/admin/furniture/newgoods/info/index.blade.php

+ 15 - 10
app/Http/Controllers/Admin/Album/AgentController.php

xqd xqd
@@ -29,7 +29,8 @@ class AgentController extends Controller
 
     function index(Request $request) {
         $search['keyword'] = $request->input('keyword');
-        $query = $this->repository->pushCriteria(new AgentWhere($search,$this->getStoreId()));
+        $search['status'] = $request->input('status') ?? -1;
+        $query = $this->repository->pushCriteria(new AgentWhere($search, $this->getStoreId()));
 
         if(isset($request['sort_field']) && $request['sort_field'] && isset($request['sort_field_by'])) {
             $query = $query->pushCriteria(new OrderBy($request['sort_field'],$request['sort_field_by']));
@@ -54,20 +55,24 @@ class AgentController extends Controller
             $user = AlbumUserModel::where('id', $item->user_id)->first();
             $item->nickname = $user->username;
             $item->is_boss = $user->is_boss;
+            $item->user_id = $user->id;
         }
         return view('admin.album.agent.index',compact('list'));
     }
 
-
-    function check(Request $request) {
-        $request = $request->all();
-        $search['keyword'] = $request->input('keyword');
-        $orderby = array();
-        if(isset($request['sort_field']) && $request['sort_field'] && isset($request['sort_field_by'])) {
-            $orderby[$request['sort_field']] = $request['sort_field_by'];
+    public function batch(Request $request)
+    {
+        $data = $request->input();
+        $IdArr = $data['data'];
+        foreach ($IdArr as $key => $val) {
+            $check = AlbumUserModel::where([['id', $val]])->first();
+            if ($check) {
+                $check->is_boss = 1;
+                $check->save();
+            }
         }
-        $list = $this->repository->search($search,$orderby);
-        return view('admin.album.agent.check',compact('list'));
+
+        return response()->json(['code' => 0, 'message' => 'success', 'data' => []]);
     }
 
 

+ 42 - 0
app/Http/Controllers/Admin/Album/CatController.php

xqd xqd
@@ -80,6 +80,38 @@ class CatController extends Controller
         return view('admin.album.cat.edit', compact('data', 'cat'));
     }
 
+    public function createFirst(Request $request)
+    {
+        if ($request->method() == 'POST') {
+            return $this->_createFirst();
+        }
+        return view('admin.album.cat.edit-first');
+    }
+
+    /**
+     * 保存修改
+     */
+    private function _createFirst()
+    {
+        $data = (array) request('data');
+        $ids = request('id');
+        $data['store_id'] = $this->getStoreId();
+        $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) {
+            $urls[] = array('url' => $url, 'title' => '返回');
+            $this->showMessage('添加成功', $urls);
+        } else {
+            $urls[] = array('url' => $url, 'title' => '返回列表');
+            return $this->showWarning('添加失败', $urls);
+        }
+    }
+
     /**
      * 保存修改
      */
@@ -118,6 +150,16 @@ class CatController extends Controller
         return view('admin.album.cat.edit', compact('data', 'cat'));
     }
 
+    public function updateFirst(Request $request)
+    {
+        if ($request->method() == 'POST') {
+            return $this->_updateSave();
+        }
+        $data = $this->repository->find($request->get('id'));
+
+        return view('admin.album.cat.edit-first', compact('data'));
+    }
+
     /**
      * 保存修改
      */

+ 111 - 2
app/Http/Controllers/Admin/Album/ManufacturerController.php

xqd xqd xqd xqd xqd
@@ -37,7 +37,8 @@ class ManufacturerController extends Controller
         return view('admin.album.manufacturer.index',compact('list','isalbum'));
     }
 
-    function index(Request $request) {
+    function index(Request $request)
+    {
         if ($request->method() == 'POST') {
             $iscreate = AlbumManufacturerModel::where('store_id', $this->getStoreId())->first();
             if ($iscreate) {
@@ -62,6 +63,96 @@ class ManufacturerController extends Controller
         return view('admin.album.manufacturer.edit', compact('data', 'video'));
     }
 
+    public function viewShare(Request $request)
+    {
+        $img = '/base/img/share.jpg';
+        return view('admin.album.poster.view', compact('img'));
+    }
+
+    public function platform(Request $request)
+    {
+        if ($request->method() == 'POST') {
+            $iscreate = AlbumManufacturerModel::where('store_id', $this->getStoreId())->first();
+            if ($iscreate) {
+                return $this->_updateSave();
+            } else {
+                return $this->_createSave();
+            }
+        }
+
+        $data = AlbumManufacturerModel::where('store_id', $this->getStoreId())->first();
+        if ($data) {
+            $data['banner'] = json_decode($data['banner'], true);
+        }
+        $banner = AgentBannerModel::where([['store_id',$this->getStoreId()],['type',0]])->get();
+        $imgs = array();
+        foreach ($banner as $key => $val) {
+            $imgs[] = $val['url'];
+        }
+        $data['agent_banner'] = $imgs;
+        $video = AgentBannerModel::where([['store_id',$this->getStoreId()],['type',1]])->first();
+        return view('admin.album.manufacturer.platform-edit', compact('data', 'video'));
+    }
+
+    public function furniturePlatform(Request $request)
+    {
+        if ($request->method() == 'POST') {
+            $iscreate = AlbumManufacturerModel::where('store_id', $this->getStoreId())->first();
+            if ($iscreate) {
+                return $this->_updateSave();
+            } else {
+                return $this->_createSave();
+            }
+        }
+
+        $data = AlbumManufacturerModel::where('store_id', $this->getStoreId())->first();
+        if ($data) {
+            $data['banner'] = json_decode($data['banner'], true);
+        }
+        return view('admin.album.manufacturer.furniture-platform', compact('data', 'video'));
+    }
+
+    public function furnitureSystem(Request $request)
+    {
+        if ($request->method() == 'POST') {
+            $iscreate = AlbumManufacturerModel::where('store_id', $this->getStoreId())->first();
+            if ($iscreate) {
+                return $this->_updateSave();
+            } else {
+                return $this->_createSave();
+            }
+        }
+
+        $data = AlbumManufacturerModel::where('store_id', $this->getStoreId())->first();
+        return view('admin.album.manufacturer.furniture-system', compact('data', 'video'));
+    }
+
+    public function albumSystem(Request $request)
+    {
+        if ($request->method() == 'POST') {
+            $iscreate = AlbumManufacturerModel::where('store_id', $this->getStoreId())->first();
+            if ($iscreate) {
+                return $this->_updateSave();
+            } else {
+                return $this->_createSave();
+            }
+
+        }
+
+        $data = AlbumManufacturerModel::where('store_id', $this->getStoreId())->first();
+        if ($data) {
+            $data['banner'] = json_decode($data['banner'], true);
+        }
+        $banner = AgentBannerModel::where([['store_id',$this->getStoreId()],['type',0]])->get();
+        $imgs = array();
+        foreach ($banner as $key => $val) {
+            $imgs[] = $val['url'];
+        }
+        $data['agent_banner'] = $imgs;
+        $video = AgentBannerModel::where([['store_id',$this->getStoreId()],['type',1]])->first();
+        return view('admin.album.manufacturer.album-edit', compact('data', 'video'));
+    }
+    
     function indexFurniture(Request $request) {
         if ($request->method() == 'POST') {
             $iscreate = AlbumManufacturerModel::where('store_id', $this->getStoreId())->first();
@@ -122,7 +213,14 @@ class ManufacturerController extends Controller
         if (!empty($data['logo'])) {
             $data['logo'] = $this->formatImgUrl($data['logo']);
         }
-
+        if (!empty($data['qrcode'])) {
+            $data['qrcode'] = $this->formatImgUrl($data['qrcode']);
+        }
+        if (!empty($data['share_image'])) {
+            $data['share'] = $this->formatImgUrl($data['share_image']);
+        }if (!empty($data['circleOfFriends'])) {
+            $data['circleOfFriends'] = $this->formatImgUrl($data['circleOfFriends']);
+        }
         if(!empty($data['background_pic']))
             $data['background_pic'] = $this->formatImgUrl($data['background_pic']);
         if(!empty($data['advertising_pic']))
@@ -145,6 +243,7 @@ class ManufacturerController extends Controller
      */
     private function _updateSave() {
         $data = (array) request('data');
+       // dd($data);
         $saveData = AlbumManufacturerModel::where('store_id', $this->getStoreId())->first();
         if (!empty($data['avatar'])) {
             $data['avatar'] = $this->formatImgUrl($data['avatar']);
@@ -181,6 +280,16 @@ class ManufacturerController extends Controller
             $data['advertising_pic'] = $this->formatImgUrl($data['advertising_pic']);
            // $this->deleteUrl($saveData->advertising_pic);
         }
+        if (!empty($data['circleOfFriends'])) {
+            $data['circleOfFriends'] = $this->formatImgUrl($data['circleOfFriends']);
+           // $this->deleteUrl($saveData->advertising_pic);
+        }
+        if (!empty($data['share_image'])) {
+            $data['share'] = $this->formatImgUrl($data['share_image']);
+        }
+        if (!empty($data['qrcode'])) {
+            $data['qrcode'] = $this->formatImgUrl($data['qrcode']);
+        }
         if (!empty($data['notice_icon'])) {
             $data['notice_icon'] = $this->formatImgUrl($data['notice_icon']);
            // $this->deleteUrl($saveData->notice_icon);

+ 123 - 18
app/Http/Controllers/Admin/Album/PosterController.php

xqd xqd xqd xqd xqd
@@ -8,7 +8,10 @@
  */
 namespace App\Http\Controllers\Admin\Album;
 use App\Http\Controllers\Admin\Controller;
+use App\Repositories\Album\Criteria\PosterWhere;
 use Illuminate\Http\Request;
+use App\Services\OSS;
+use App\Models\AlbumPosterModel;
 use App\Repositories\Base\Criteria\OrderBy;
 use App\Repositories\Album\Criteria\MultiWhere;
 use App\Repositories\Album\PosterRepository;
@@ -24,6 +27,62 @@ class PosterController extends Controller
         }
     }
 
+    function index(Request $request)
+    {
+        $search['keyword'] = $request->input('keyword');
+        $query = $this->repository->pushCriteria(new PosterWhere($search, $this->getStoreId()));
+
+
+        if (isset($request['sort_field']) && $request['sort_field'] && isset($request['sort_field_by'])) {
+            $query = $query->pushCriteria(new OrderBy($request['sort_field'], $request['sort_field_by']));
+        } else {
+            $query = $query->pushCriteria(new OrderBy('id', 'DESC'));
+        }
+        $list = $query->paginate();
+        //dd($list);
+        return view('admin.album.poster.index', compact('list'));
+    }
+
+    /**
+     * 添加
+     *
+     */
+    public function create(Request $request)
+    {
+        if ($request->method() == 'POST') {
+            return $this->_createSave();
+        }
+        return view('admin.album.poster.edit');
+    }
+
+    private function _createSave()
+    {
+        $data = (array) request('data');
+        if (request()->file('video_url')) {
+            $data['video_url'] = $this->uploadVideo(request()->file('video_url'), '');
+        }
+        if (!empty($data['posters']['url'])) {
+            foreach ($data['posters']['url'] as $key => $val) {
+                $data['posters']['url'][$key] = $this->formatImgUrl($val);
+            }
+            $data['posters'] = json_encode($data['posters']['url']);
+        }
+        $data['store_id'] = $this->getStoreId();
+        /*if (empty($data['qrcode'])) {
+            return $this->showMessage('分享海报或者二维码不能为空!');
+        }
+        $data['qrcode'] = $this->formatImgUrl($data['qrcode']);*/
+
+
+        $ok = $this->repository->create($data);
+
+        if ($ok) {
+            return $this->showMessage('操作成功');
+        } else {
+            return $this->showMessage('操作失败');
+        }
+    }
+
     /**
      * 修改
      */
@@ -32,11 +91,12 @@ class PosterController extends Controller
         if ($request->method() == 'POST') {
             return $this->updateSave();
         }
-        $data = $this->repository->findWhere(['store_id' => $this->getStoreId()])->toArray();
+        $data = $this->repository->findWhere(['id' => $request->input('id')])->toArray();
         if (!empty($data)) {
             $data = $data[0];
             $data['posters'] = json_decode($data['posters'], true);
-            $data['words'] = json_decode($data['words'], true);
+            $data['video_url'] = json_decode($data['video_url'], true);
+            $data['video_url'] = $data['video_url']['url'];
         }
         return view('admin.album.poster.edit', compact('data'));
     }
@@ -47,27 +107,26 @@ class PosterController extends Controller
     private function updateSave()
     {
         $data = (array) request('data');
+
+        if (request()->file('video_url')) {
+            $data['video_url'] = $this->uploadVideo(request()->file('video_url'), request('id'));
+        }
         if (!empty($data['posters']['url'])) {
             foreach ($data['posters']['url'] as $key => $val) {
                 $data['posters']['url'][$key] = $this->formatImgUrl($val);
             }
             $data['posters'] = json_encode($data['posters']['url']);
         }
-        if (empty($data['share']) || empty($data['qrcode'])) {
+
+       /* if (empty($data['qrcode'])) {
             return $this->showMessage('分享海报或者二维码不能为空!');
         }
-        $data['share'] = $this->formatImgUrl($data['share']);
-        $data['qrcode'] = $this->formatImgUrl($data['qrcode']);
-        if (!empty($data['words'])) {
-            $data['words'] = json_encode($data['words']);
-        }
+        $data['qrcode'] = $this->formatImgUrl($data['qrcode']);*/
+
         $id = request('id');
-        if (empty($id)) {
-            $data['store_id'] = $this->getStoreId();
-            $ok = $this->repository->create($data);
-        } else {
-            $ok = $this->repository->update($id, $data);
-        }
+
+        $ok = $this->repository->update($id, $data);
+
         if ($ok) {
             return $this->showMessage('操作成功');
         } else {
@@ -75,16 +134,62 @@ class PosterController extends Controller
         }
     }
 
+    public function uploadVideo($video, $id)
+    {
+        // dd($video);
+// 判断图片有效性
+        if (!$video) {
+            return back()->withErrors('上传视频无效..');
+        }
+        if ($id) {
+            $check = AlbumPosterModel::where([['id',$id]])->first();
+            if ($check) {
+                $res = json_decode($check->video_url, true);
+                if ($res != '') {
+                    OSS::publicDeleteObject(config('alioss.BucketName'), $res['oss_key']);
+                }
+            }
+        }
+
+// 获取图片在临时文件中的地址
+        $videoPath = $video->getRealPath();
+//       / dd($video);
+// 制作文件名
+        $ex = $video->getClientOriginalExtension();
+        $key = time() . rand(10000, 99999999) . '.' . $ex;
+//阿里 OSS 文件上传
+        $result = OSS::publicUpload(config('alioss.BucketName'), $key, $videoPath);
+        if ($result) {
+            $data['oss_key'] =  $key;
+            $data['url'] = config('alioss.FileUrl') . $key;
+            $data = json_encode($data);
+            return $data;
+        } else {
+            return false;
+        }
+    }
 
     public function viewPoster(Request $request)
     {
         $img = '/base/img/poster.jpg';
         return view('admin.album.poster.view', compact('img'));
     }
-
-    public function viewShare(Request $request)
+    /**
+     * 删除
+     */
+    public function destroy(Request $request)
     {
-        $img = '/base/img/share.jpg';
-        return view('admin.album.poster.view', compact('img'));
+        //$bool = $this->repository->destroy($request->get('id'));
+        $cat = AlbumPosterModel::find($request->get('id'));
+        $res = json_decode($cat->video_url, true);
+        if ($res != '') {
+            OSS::publicDeleteObject(config('alioss.BucketName'), $res['oss_key']);
+        }
+        $ok = $cat->delete();
+        if ($ok) {
+            return  $this->showMessage('操作成功');
+        } else {
+            return  $this->showWarning("操作失败");
+        }
     }
 }

+ 8 - 20
app/Http/Controllers/Admin/Album/ProductController.php

xqd xqd xqd xqd xqd
@@ -16,7 +16,6 @@ use App\Repositories\Album\Criteria\ProductWhere;
 use App\Services\OSS;
 use Illuminate\Http\Request;
 use App\Repositories\Base\Criteria\OrderBy;
-use App\Repositories\Album\Criteria\MultiWhere;
 use App\Repositories\Album\ProductRepository;
 
 class ProductController extends Controller
@@ -46,20 +45,6 @@ class ProductController extends Controller
             $query = $query->pushCriteria(new OrderBy('id', 'DESC'));
         }
         $list = $query->paginate();
-        foreach ($list as $key => $item) {
-            $cat = AlbumCatModel::where('id', $item->cat_id)->first();
-            if ($cat) {
-                $catParent = AlbumCatModel::where('id', $cat->parent_id)->first();
-            }
-
-            $item->cat_name = ($catParent->name ?? '暂无') . '>' . ($cat->name ?? '暂无');
-            $upload_img = json_decode($item->upload_img);
-            $attr = json_decode($item->attr);
-            $detail = json_decode($item->detail);
-            $list[$key]['install_img'] = $upload_img[0];
-            $list[$key]['specifications_img'] = $attr[0];
-            $list[$key]['detail'] = $detail[0];
-        }
         //dd($list);
         return view('admin.album.product.index', compact('list'));
     }
@@ -135,8 +120,8 @@ class ProductController extends Controller
     {
         $data = (array) request('data');
       //  dd($data);
-        if (isset($data['upload_video'])) {
-            $data['upload_video'] = $this->uploadVideo($data['upload_video'], '');
+        if (!empty(request()->file('upload_video'))) {
+            $data['upload_video'] = $this->uploadVideo(request()->file('upload_video'), request('id'));
         }
 
         $data['store_id'] = $this->getStoreId();
@@ -192,7 +177,10 @@ class ProductController extends Controller
             $check = AlbumProductModel::where([['id',$id]])->first();
             if ($check) {
                 $res = json_decode($check->upload_video, true);
-                OSS::publicDeleteObject(config('alioss.BucketName'), $res['oss_key']);
+                if ($res) {
+                    OSS::publicDeleteObject(config('alioss.BucketName'), $res['oss_key']);
+                }
+
             }
         }
 
@@ -250,8 +238,8 @@ class ProductController extends Controller
     private function _updateSave()
     {
         $data = (array) request('data');
-        if (isset($data['upload_video'])) {
-            $data['upload_video'] = $this->uploadVideo($data['upload_video'], request('id'));
+        if (!empty(request()->file('upload_video'))) {
+            $data['upload_video'] = $this->uploadVideo(request()->file('upload_video'), request('id'));
         }
 
         if (!empty($data['specifications_img']['url'])) {

+ 43 - 56
app/Http/Controllers/Admin/Album/UserController.php

xqd xqd xqd xqd xqd
@@ -24,10 +24,10 @@ class UserController extends Controller
         if(!$this->repository) $this->repository = $repository;
     }
 
-    function index(Request $request) {
+    function furnitureIndex(Request $request) {
         $search['keyword'] = $request->input('keyword');
         $search['storeid'] = $this->getStoreId();
-
+        $search['role'] = $request->input('role') ?? -1;
         $order = array();
         if(isset($request['sort_field']) && $request['sort_field'] && isset($request['sort_field_by'])) {
             $order[$request['sort_field']] = $request['sort_field_by'];
@@ -38,55 +38,53 @@ class UserController extends Controller
         $list = $this->repository->searchUser($search,$order);
         //dd($list);
 //        dump($list);die;
-        return view('admin.album.user.index',compact('list'));
+        return view('admin.album.user.furniture-index',compact('list'));
     }
 
-
-    function check(Request $request) {
-        $request = $request->all();
+    function albumIndex(Request $request) {
         $search['keyword'] = $request->input('keyword');
-        $orderby = array();
+        $search['storeid'] = $this->getStoreId();
+        $search['is_boss'] = $request->input('is_boss') ?? -1;
+        $order = array();
         if(isset($request['sort_field']) && $request['sort_field'] && isset($request['sort_field_by'])) {
-            $orderby[$request['sort_field']] = $request['sort_field_by'];
+            $order[$request['sort_field']] = $request['sort_field_by'];
+        }else{
+            $order['id']='DESC';
         }
-        $list = $this->repository->search($search,$orderby);
-        return view('admin.album.user.check',compact('list'));
+
+        $list = $this->repository->searchUser($search,$order);
+        //dd($list);
+//        dump($list);die;
+        return view('admin.album.user.album-index',compact('list'));
     }
 
 
-    /**
-     * 添加
-     * 
-     */
-    public function create(Request $request)
-    {
-        if($request->method() == 'POST') {
-            return $this->_createSave();
-        }
-        return view('admin.album.user.edit');
+
+    public function view(Request $request) {
+        $data = $this->repository->find(request('id'));
+        return view('admin.album.user.view',compact('data'));
     }
 
+
     /**
-     * 保存修改
+     *
+     * 状态改变
+     *
      */
-    private function _createSave(){
-        $data = (array) request('data');
-        $id = $this->repository->create($data);
-        if($id) {
-            $url[] = array('url'=>U( 'Album/User/index'),'title'=>'返回列表');
-            $url[] = array('url'=>U( 'Album/User/create'),'title'=>'继续添加');
-            $this->showMessage('添加成功',$url);
+    public function status(Request $request) {
+        $ok = $this->repository->updateStatus(request('id'),request('status'));
+        if($ok) {
+            return $this->showMessage('操作成功');
         }else{
-            $url[] = array('url'=>U( 'Album/User/index'),'title'=>'返回列表');
-            return $this->showWarning('添加失败',$url);
+            return $this->showWarning('操作失败');
         }
     }
-    
+
     /**
-     * 
+     *
      * 修改
-     * 
-     * 
+     *
+     *
      */
     public function update(Request $request) {
         $data = $this->repository->find($request->get('id'));
@@ -108,7 +106,7 @@ class UserController extends Controller
                 return $this->showWarning('操作失败');
             }
         }
-        return view('admin.album.user.edit',compact('data'));
+        
     }
 
     /**
@@ -126,26 +124,7 @@ class UserController extends Controller
         }
     }
 
-    public function view(Request $request) {
-        $data = $this->repository->find(request('id'));
-        return view('admin.album.user.view',compact('data'));
-    }
-
 
-    /**
-     *
-     * 状态改变
-     *
-     */
-    public function status(Request $request) {
-        $ok = $this->repository->updateStatus(request('id'),request('status'));
-        if($ok) {
-            return $this->showMessage('操作成功');
-        }else{
-            return $this->showWarning('操作失败');
-        }
-    }
-    
     /**
      * 删除
      */
@@ -159,8 +138,16 @@ class UserController extends Controller
     }
 
     public function role(Request $request){
-        $user = AlbumUserModel::find(request('id'));
-        $user->role = request('role');
+        $id = request('id');
+        $role = request('role');
+        $user = AlbumUserModel::find($id);
+        if ($role == 4) {
+            $user->is_boss = 1;
+        } else if ($role == 5) {
+            $user->is_boss = 0;
+        } else {
+            $user->role = $role;
+        }
         $ok = $user->save();
         if($ok) {
             return $this->showMessage('操作成功');

+ 2 - 8
app/Http/Controllers/Admin/Base/PhotosController.php

xqd xqd
@@ -29,12 +29,11 @@ class PhotosController extends Controller
         $a_class = $request->has('class') ? $request->input('class') : null;
 
         if ($userAuth->is_root == 1) {
-            if (($a_class = ClassModel::find($a_class)) == null || empty(($a_class = ClassModel::find($a_class))->item)) {
+            if (($a_class = ClassModel::find($a_class)) == null) {
                 $a_class = ClassModel::first();
             }
         } else {
-            $a_class['store_id'] = $this->getStoreId();
-            if (($a_class = ClassModel::find($a_class)) == null || empty(($a_class = ClassModel::find($a_class))->item)) {
+            if (($a_class = ClassModel::find($a_class)) == null) {
                 $a_class = ClassModel::where('store_id', $this->getStoreId())->first();
             }
         }
@@ -58,11 +57,6 @@ class PhotosController extends Controller
                 } else {
                     $photos = BaseAttachmentModel::where([['class', $a_class->class],['store_id', $this->getStoreId()]])->paginate(24);
                 }
-            } else {
-                $save['store_id'] = $this->getStoreId();
-                $save['class'] = '未分类';
-                ClassModel::create($save);
-                $a_class = ClassModel::where('store_id', $this->getStoreId())->first();
             }
         }
 

+ 194 - 117
app/Http/Controllers/Admin/Base/UserController.php

xqd
@@ -1,179 +1,256 @@
 <?php
 /**
- *  用户管理
- *  @author  system
+ *  
+ *  @author  Mike <m@9026.com>
  *  @version    1.0
- *  @date 2018-05-14 13:25:12
+ *  @date 2015年10月12日
  *
  */
-namespace App\Http\Controllers\Admin\Album;
+namespace App\Http\Controllers\Admin\Base;
+
 use App\Http\Controllers\Admin\Controller;
-use App\Models\AlbumAgentModel;
+use App\Models\AdminUserModel;
+use App\Models\AlbumManufacturerModel;
 use App\Models\AlbumUserModel;
-use App\Repositories\Album\Criteria\UserWhere;
-use Illuminate\Http\Request;
-use App\Repositories\Base\Criteria\OrderBy;
-use App\Repositories\Album\Criteria\MultiWhere;
-use App\Repositories\Album\UserRepository;
+use App\Services\Admin\Role;
+use App\Services\Admin\AdminUser;
+use Request;
 
 class UserController extends Controller
 {
-    private $repository;
+    private $_service;
+    private $_role_service;
 
-    public function __construct(UserRepository $repository) {
-        if(!$this->repository) $this->repository = $repository;
+    /**
+     * 初始化Service
+     */
+    public function __construct()
+    {
+        parent::__construct();
+        if(!$this->_service) $this->_service = new AdminUser();
+        if(!$this->_role_service) $this->_role_service = new Role();
     }
+    
+    /**
+     * 列表
+     */
+    function index()
+    {
+        $request = Request::all();
+        $search['keyword'] = Request::input('keyword');
 
-    function index(Request $request) {
-        $search['keyword'] = $request->input('keyword');
-        $search['storeid'] = $this->getStoreId();
-
-        $order = array();
+        $orderby = array();
         if(isset($request['sort_field']) && $request['sort_field'] && isset($request['sort_field_by'])) {
-            $order[$request['sort_field']] = $request['sort_field_by'];
-        }else{
-            $order['id']='DESC';
+            $orderby[$request['sort_field']] = $request['sort_field_by'];
         }
-
-        $list = $this->repository->searchUser($search,$order);
+        if ($this->_user->is_root == 1) {
+            $store_id = 0;
+        } else {
+            $store_id = $this->getStoreId();
+        }
+        $list = $this->_service->search($search, $orderby, $store_id);
         //dd($list);
-//        dump($list);die;
-        return view('admin.album.user.index',compact('list'));
+        foreach ($list as $item) {
+            $item->store = '暂无';
+            $store = AlbumManufacturerModel::where('store_id', $item->store_id)->first();
+            if ($store) {
+                $item->store = $store->name;
+            }
+        }
+        $roles = pairList($this->_getRoles(), 'id', 'name');
+        return view('admin.base.user.index', compact('list', 'roles'));
     }
 
-
-    function check(Request $request) {
-        $request = $request->all();
-        $search['keyword'] = $request->input('keyword');
+    /**
+     * 列表
+     */
+    function resetPwd()
+    {
+//        $pwd = '$2y$10$jRQGg4qdfDhdt.4TZpDaL.2pbgBJZqvdR.AMrE5rA2D3dgMyit8vS';
+//        var_dump(crypt('abcded', $pwd));exit;
+        $request = Request::all();
+        $search['keyword'] = Request::input('keyword');
+        $search['resetPwd'] =true;
         $orderby = array();
         if(isset($request['sort_field']) && $request['sort_field'] && isset($request['sort_field_by'])) {
             $orderby[$request['sort_field']] = $request['sort_field_by'];
         }
-        $list = $this->repository->search($search,$orderby);
-        return view('admin.album.user.check',compact('list'));
+        $list = $this->_service->search($search, $orderby);
+        return view('admin.base.user.resetPwd', compact('list'));
     }
 
+    function resetPwdPass()
+    {
+        $ok = $this->_service->resetPwdPass(Request::get('id'));
+        if($ok) {
+            $this->showMessage('操作成功');
+        }else{
+            $this->showWarning('操作失败');
+        }
+    }
 
-    /**
-     * 添加
-     *
-     */
-    public function create(Request $request)
+    function resetPwdReject()
     {
-        if($request->method() == 'POST') {
-            return $this->_createSave();
+        $ok = $this->_service->resetPwdReject(Request::get('id'));
+        if($ok) {
+            $this->showMessage('操作成功');
+        }else{
+            $this->showWarning('操作失败');
         }
-        return view('admin.album.user.edit');
     }
 
+
+
     /**
-     * 保存修改
+     * 更新
      */
-    private function _createSave(){
-        $data = (array) request('data');
-        $id = $this->repository->create($data);
-        if($id) {
-            $url[] = array('url'=>U( 'Album/User/index'),'title'=>'返回列表');
-            $url[] = array('url'=>U( 'Album/User/create'),'title'=>'继续添加');
-            $this->showMessage('添加成功',$url);
+    public function create()
+    {
+        if(Request::method() == 'POST'){
+            $data = Request::input('info');
+            if ($this->_user['is_root'] != 1) {
+                $data['store_id'] = $this->getStoreId();
+            }
+
+            if(isset($data['admin_role_id']))$data['admin_role_id'] = implode(',', $data['admin_role_id']);
+            if($this->_service->create($data)){
+                $this->showMessage('操作成功', urldecode(Request::input('_referer')));
+            }else{
+                $this->showWarning('操作失败'  . $this->_service->getMsg(), urldecode(Request::input('_referer')));
+            }
+        }
+        $data = $this->_service->find(Request::input('id'));
+        $data['is_root'] = $this->_user['is_root'];
+        if($this->_user['is_root']) {
+            $roles = $this->_getRoles();
         }else{
-            $url[] = array('url'=>U( 'Album/User/index'),'title'=>'返回列表');
-            return $this->showWarning('添加失败',$url);
+            $roles = $this->_getCurrentRoles();
         }
+        return view('admin.base.user.edit', compact('data', 'roles'));
     }
 
+
     /**
-     *
-     * 修改
-     *
-     *
+     * 更新
      */
-    public function update(Request $request) {
-        $data = $this->repository->find($request->get('id'));
-        if($data->is_dealer == 1){
-            return $this->showWarning('该用户已成为经销商');
-        }
-        $save['is_dealer'] = 1;
-        $ok = $this->repository->update(request('id'),$save);
-
-        if($ok){
-            $add['store_id'] = $this->getStoreId();
-            $add['user_id'] = $data->id;
-            $add['name'] = $data->username;
-            $add['status'] = 1;
-            $res = AlbumAgentModel::create($add);
-            if($res) {
-                return $this->showMessage('操作成功');
+    public function update()
+    {
+        if(Request::method() == 'POST')
+        {
+            $data = Request::input('info');
+            if ($data['password'] == null) {
+                unset($data['password']);
+            }
+            if ($this->_user['is_root'] != 1) {
+                $data['store_id'] = $this->getStoreId();
+            }
+          //  dd($data);
+            if(isset($data['admin_role_id']))$data['admin_role_id'] = implode(',', $data['admin_role_id']);
+            if($this->_service->update(Request::input('id'), $data)){
+                $this->showMessage('操作成功', urldecode(Request::input('_referer')));
+            }else{
+                $this->showWarning('操作失败' . $this->_service->getMsg(), urldecode(Request::input('_referer')));
+            }
+        }
+        $data = $this->_service->find(Request::input('id'));
+        $data['is_root'] = $this->_user['is_root'];
+        if($this->_user['is_root']){
+            $roles = $this->_getRoles();
+        }else{
+            $roles = $this->_getCurrentRoles();
+        }
+        $store = AlbumManufacturerModel::where('store_id', $data['store_id'])->first(['store_id', 'name', 'phone'])->toArray();
+        return view('admin.base.user.edit', compact('data', 'roles', 'store'));
+    }
+    
+    public function auth() {
+        if(Request::method() == 'POST'){
+            $info = Request::input('info');
+            if(!empty($info['admin_role_id'])){
+                $info['admin_role_id'] = implode(',', $info['admin_role_id']);
+            }
+            if(!$info['id']) {
+                $this->showWarning('数据不全', urldecode(Request::input('_referer')));
+            }
+            if($this->_service->auth($info)){
+                $this->showMessage('操作成功', urldecode(Request::input('_referer')));
             }else{
-                return $this->showWarning('操作失败');
+                $this->showWarning('操作失败'. $this->_service->getMsg(), urldecode(Request::input('_referer')));
             }
         }
-        return view('admin.album.user.edit',compact('data'));
+        if($this->_user['is_root']){
+            $roles = $this->_getRoles();
+        }else{
+            $roles = $this->_getCurrentRoles();
+        }
+        return view('admin.base.user.auth', compact( 'roles'));
     }
 
-    /**
-     * 保存修改
-     */
-    private function _updateSave() {
-        $data = (array) request('data');
-        $ok = $this->repository->update(request('id'),$data);
+    public function status() {
+        $ok = $this->_service->updateStatus(Request::get('id'),Request::get('status'));
         if($ok) {
-            $url[] = array('url'=>U( 'Album/User/index'),'title'=>'返回列表');
-            return $this->showMessage('操作成功',urldecode(request('_referer')));
+            $this->showMessage('操作成功');
         }else{
-            $url[] = array('url'=>U( 'Album/User/index'),'title'=>'返回列表');
-            return $this->showWarning('操作失败',$url);
+            $this->showWarning('操作失败' . $this->_service->getMsg());
         }
     }
 
-    public function view(Request $request) {
-        $data = $this->repository->find(request('id'));
-        return view('admin.album.user.view',compact('data'));
+
+    /**
+     * 得到当前角色所拥有的角色
+     */
+    private function _getCurrentRoles()
+    {
+        $_node = $this->_getRoleNode();
+        return $this->_role_service->getChildByLevel($_node['level'])->toArray();
+    }
+    
+    /**
+     * 获取角色权限节点(level越小权限越大)
+     */
+    private function _getRoleNode()
+    {
+        return $this->_role_service->getLevelNode($this->_user['admin_role_id'])->toArray();
     }
 
+    public function searchStore()
+    {
+        $keyword = Request::post('keywords');
+        $query = AlbumManufacturerModel::where('id','>',0);
+        if(isset($keyword) && $keyword) {
+            $query = $query->where('id','like','%'.$keyword.'%')
+                ->orWhere('phone','like','%'.$keyword.'%')
+                ->orWhere('name','like','%'.$keyword.'%');
+        }
+        $list = $query->get(['name','id','phone'])->toArray();
+        if(empty($list)){
+            $list[0]=[
+                'id'=>0,
+                'name'=>'暂无'
+            ];
+        }
+        return response()->json(['code' => 0, 'message' => '', 'data' => $list]);
+    }
 
     /**
-     *
-     * 状态改变
-     *
+     * 得到所有角色
      */
-    public function status(Request $request) {
-        $ok = $this->repository->updateStatus(request('id'),request('status'));
-        if($ok) {
-            return $this->showMessage('操作成功');
-        }else{
-            return $this->showWarning('操作失败');
-        }
+    private function _getRoles()
+    {
+        return $this->_role_service->get()->toArray();
     }
 
     /**
      * 删除
      */
-    public function destroy(Request $request) {
-        $bool = $this->repository->destroy($request->get('id'));
-        if($bool) {
+    public function destroy()
+    {
+        $user = AdminUserModel::find(Request::get('id'));
+        $ok = $user->delete();
+        if ($ok) {
             return  $this->showMessage('操作成功');
-        }else{
-            return  $this->showWarning("操作失败");
-        }
-    }
-
-    public function role(Request $request){
-        $id = request('id');
-        $role = request('role');
-        $user = AlbumUserModel::find($id);
-        if ($role == 4) {
-            $user->is_boss = 1;
-        } else if ($role == 5) {
-            $user->is_boss = 0;
         } else {
-            $user->role = $role;
-        }
-        $ok = $user->save();
-        if($ok) {
-            return $this->showMessage('操作成功');
-        }else{
-            return $this->showWarning('操作失败');
+            return  $this->showWarning("操作失败");
         }
     }
 }

+ 12 - 34
app/Http/Controllers/Api/V1/AlbumBossController.php

xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd
@@ -59,9 +59,7 @@ class AlbumBossController extends Controller
     public function getTop(Request $request)
     {
         $userAuth = Auth('api')->user();
-        if (!$userAuth) {
-            return $this->error(ErrorCode::ERROR_POWER, '登陆过期!');
-        }
+
         $validator = Validator::make($request->all(), [
             'store_id' => 'required'
         ], [
@@ -136,9 +134,7 @@ class AlbumBossController extends Controller
     public function agentCustomer(Request $request)
     {
         $userAuth = Auth('api')->user();
-        if (!$userAuth) {
-            return $this->error(ErrorCode::ERROR_POWER, '登陆过期!');
-        }
+
         $validator = Validator::make($request->all(), [
             'store_id' => 'required',
             'agent_id' => 'required',
@@ -234,9 +230,7 @@ class AlbumBossController extends Controller
     public function agentStatistical(Request $request)
     {
         $userAuth = Auth('api')->user();
-        if (!$userAuth) {
-            return $this->error(ErrorCode::ERROR_POWER, '登陆过期!');
-        }
+
         $validator = Validator::make($request->all(), [
             'store_id' => 'required',
             'agent_id' => 'required',
@@ -344,9 +338,7 @@ class AlbumBossController extends Controller
     {
 
         $userAuth = Auth('api')->user();
-        if (!$userAuth) {
-            return $this->error(ErrorCode::ERROR_POWER, '登陆过期!');
-        }
+
         $validator = Validator::make($request->all(), [
             'store_id' => 'required',
         ], [
@@ -421,9 +413,7 @@ class AlbumBossController extends Controller
     {
 
         $userAuth = Auth('api')->user();
-        if (!$userAuth) {
-            return $this->error(ErrorCode::ERROR_POWER, '登陆过期!');
-        }
+
         $validator = Validator::make($request->all(), [
             'store_id' => 'required',
         ], [
@@ -454,7 +444,7 @@ class AlbumBossController extends Controller
             ['store_id', $store_id],
             ['updated_at','>=',$start],
             ['updated_at','<=',$end]
-        ])->count();
+            ])->count();
         $downloadCount = AlbumWatchRecord::where([
             ['store_id', $store_id],
             ['action', 9],
@@ -519,9 +509,7 @@ class AlbumBossController extends Controller
     {
 
         $userAuth = Auth('api')->user();
-        if (!$userAuth) {
-            return $this->error(ErrorCode::ERROR_POWER, '登陆过期!');
-        }
+
         $validator = Validator::make($request->all(), [
             'store_id' => 'required',
         ], [
@@ -589,9 +577,7 @@ class AlbumBossController extends Controller
     {
 
         $userAuth = Auth('api')->user();
-        if (!$userAuth) {
-            return $this->error(ErrorCode::ERROR_POWER, '登陆过期!');
-        }
+
         $validator = Validator::make($request->all(), [
             'store_id' => 'required',
         ], [
@@ -671,9 +657,7 @@ class AlbumBossController extends Controller
     {
 
         $userAuth = Auth('api')->user();
-        if (!$userAuth) {
-            return $this->error(ErrorCode::ERROR_POWER, '登陆过期!');
-        }
+
         $validator = Validator::make($request->all(), [
             'store_id' => 'required',
         ], [
@@ -761,9 +745,7 @@ class AlbumBossController extends Controller
     {
 
         $userAuth = Auth('api')->user();
-        if (!$userAuth) {
-            return $this->error(ErrorCode::ERROR_POWER, '登陆过期!');
-        }
+
         $validator = Validator::make($request->all(), [
             'store_id' => 'required',
         ], [
@@ -840,9 +822,7 @@ class AlbumBossController extends Controller
     public function agentAnalysis(Request $request)
     {
         $userAuth = Auth('api')->user();
-        if (!$userAuth) {
-            return $this->error(ErrorCode::ERROR_POWER, '登陆过期!');
-        }
+
         $validator = Validator::make($request->all(), [
             'store_id' => 'required',
         ], [
@@ -900,9 +880,7 @@ class AlbumBossController extends Controller
     public function BossInteractive(Request $request)
     {
         $userAuth = Auth('api')->user();
-        if (!$userAuth) {
-            return $this->error(ErrorCode::ERROR_POWER, '登陆过期!');
-        }
+
         $validator = Validator::make($request->all(), [
             'store_id' => 'required',
         ], [

+ 52 - 72
app/Http/Controllers/Api/V1/AlbumController.php

xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd
@@ -217,7 +217,7 @@ class AlbumController extends Controller
                     ['agent_id', $userAuth->up_agent_id],['open_id', $check->open_id],['store_id', $datas['store_id']]
                 ])->first();
                 $check_user = AlbumWatchRecord::where([
-                    ['open_id', $check->open_id],['store_id', $datas['store_id']]
+                  ['open_id', $check->open_id],['store_id', $datas['store_id']]
                 ])->first();
                 \Log::info($check_user);
 
@@ -226,11 +226,11 @@ class AlbumController extends Controller
                 } else {
                     $add_record['is_new'] = 1;
                 }
-                // \Log::info($add_record);
+               // \Log::info($add_record);
                 AlbumWatchRecord::create($add_record);
-                //  dd($add_record);
+              //  dd($add_record);
                 $user_agent = AlbumAgentModel::where([['id',$add_record['agent_id']],['store_id',$datas['store_id']]])->first();
-                // dd($user_agent);
+               // dd($user_agent);
                 if ($user_agent) {
                     if (empty($check_new_customer)) {
                         $user_agent->get_count++;
@@ -333,9 +333,7 @@ class AlbumController extends Controller
     public function albumGoods(Request $request)
     {
         $userAuth = Auth('api')->user();
-        if (!$userAuth) {
-            return $this->error(ErrorCode::ERROR_POWER, '登陆过期!');
-        }
+
         $validator = Validator::make($request->all(), [
             'cat_id' => 'required',
             'parent_id' => 'required',
@@ -486,17 +484,15 @@ class AlbumController extends Controller
     {
         //  $userAuth = AlbumXyxUserModel::find(1);
         $userAuth = Auth('api')->user();
-        if (!$userAuth) {
-            return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '未登录!');
-        }
+
         $validator = Validator::make($request->all(), [
             'goods_id' => 'required',
             'store_id' => 'required',
-            //      'parent_id' => 'required',
+      //      'parent_id' => 'required',
         ], [
             'goods_id.required' => '缺少商品参数',
             'store_id.required' => '缺少STORE参数',
-            //      'parent_id.required' => '缺少PARENT参数',
+      //      'parent_id.required' => '缺少PARENT参数',
         ]);
         if ($validator->fails()) {
             return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '传入参数不正确!', $validator->messages());
@@ -638,9 +634,7 @@ class AlbumController extends Controller
     public function albumFavoriteList(Request $request)
     {
         $userAuth = Auth('api')->user();
-        if (!$userAuth) {
-            return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '未登录!');
-        }
+
         $validator = Validator::make($request->all(), [
             'store_id' => 'required',
         ], [
@@ -704,9 +698,7 @@ class AlbumController extends Controller
     public function albumGetWatchRecord(Request $request)
     {
         $userAuth = Auth('api')->user();
-        if (!$userAuth) {
-            return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '未登录!');
-        }
+
         $validator = Validator::make($request->all(), [
             'store_id' => 'required',
             'type' => 'required'
@@ -848,9 +840,7 @@ class AlbumController extends Controller
     public function albumGetDataGoods(Request $request)
     {
         $userAuth = Auth('api')->user();
-        if (!$userAuth) {
-            return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '未登录!');
-        }
+
         $validator = Validator::make($request->all(), [
             'store_id' => 'required'
         ], [
@@ -928,9 +918,7 @@ class AlbumController extends Controller
     public function albumGetDataCat(Request $request)
     {
         $userAuth = Auth('api')->user();
-        if (!$userAuth) {
-            return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '未登录!');
-        }
+
         $validator = Validator::make($request->all(), [
             'store_id' => 'required',
             'parent_id' => 'required'
@@ -1005,9 +993,7 @@ class AlbumController extends Controller
     public function albumGetDataCatSingle(Request $request)
     {
         $userAuth = Auth('api')->user();
-        if (!$userAuth) {
-            return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '未登录!');
-        }
+
         $validator = Validator::make($request->all(), [
             'store_id' => 'required',
             'open_id' => 'required',
@@ -1105,9 +1091,7 @@ class AlbumController extends Controller
     public function albumGetCartOfWatch(Request $request)
     {
         $userAuth = Auth('api')->user();
-        if (!$userAuth) {
-            return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '未登录!');
-        }
+
         $validator = Validator::make($request->all(), [
             'store_id' => 'required',
             'end' => 'required',
@@ -1241,7 +1225,7 @@ class AlbumController extends Controller
     {
         //$userAuth = AlbumXyxUserModel::find(1);
         $userAuth = Auth('api')->user();
-        if(!$userAuth) return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '未登录!');
+
         $validator = Validator::make($request->all(), [
             'store_id' => 'required',
             'favorite_id' => 'required',
@@ -1307,7 +1291,7 @@ class AlbumController extends Controller
     public function albumSaveFormId(Request $request)
     {
         $userAuth = Auth('api')->user();
-        if(!$userAuth) return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '未登录!');
+
         $validator = Validator::make($request->all(), [
             'store_id' => 'required',
             'form_id' => 'required',
@@ -1366,7 +1350,7 @@ class AlbumController extends Controller
     public function albumAddFavorite(Request $request)
     {
         $userAuth = Auth('api')->user();
-        if(!$userAuth) return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '未登录!');
+
         $validator = Validator::make($request->all(), [
             'store_id' => 'required',
             'product_id' => 'required',
@@ -1643,7 +1627,7 @@ class AlbumController extends Controller
     public function albumSavePhone(Request $request)
     {
         $userAuth = Auth('api')->user();
-        if(!$userAuth) return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '未登录!');
+
         $validator = Validator::make($request->all(), [
             'store_id' => 'required',
             'code' => 'required',
@@ -1729,7 +1713,7 @@ class AlbumController extends Controller
     public function albumSetWatch(Request $request)
     {
         $userAuth = Auth('api')->user();
-        if(!$userAuth) return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '未登录!');
+
         $validator = Validator::make($request->all(), [
             'store_id' => 'required',
             'type' => 'required',
@@ -1885,11 +1869,11 @@ class AlbumController extends Controller
         \Log::info($value);\Log::info('2225');
         if ($open_id && !empty($weChatApp->wxaccount_template_id) && (!$value || ($value + 60) <= time())) {
             Cache::put($open_id, time(), 1);
-            /*  $config = [
-                  'app_id' => $weChatApp->G_app_id,
-                  'secret' => $weChatApp->G_app_secret,
-                  'response_type' => 'array',
-              ];*/
+          /*  $config = [
+                'app_id' => $weChatApp->G_app_id,
+                'secret' => $weChatApp->G_app_secret,
+                'response_type' => 'array',
+            ];*/
 
             $ac = $this->getAccessToken($weChatApp);
             $url = "https://api.weixin.qq.com/cgi-bin/message/wxopen/template/uniform_send?access_token=" . $ac;
@@ -1909,28 +1893,28 @@ class AlbumController extends Controller
                         "keyword1" => array( "value" => $name, "color" => "#93c47d" ),
                         "keyword2" => array( "value" => $date, "color" => "#0000ff" ),
                         "remark" => array( "value" => $content, "color" => "#0000ff" ),
-                        //  "remark" => array( "value" => $date, "color" => "#45818e" )
+                      //  "remark" => array( "value" => $date, "color" => "#45818e" )
                     )
                 )
             );
             $data = json_encode($data, JSON_UNESCAPED_UNICODE);
             $res = $this->curlPost($url, $data);
             $res = json_decode($res, true);
-            /* $app = Factory::officialAccount($config);
-             $res = $app->template_message->send([
-                 'touser' => $g_open_id,
-                 'template_id' => $weChatApp->wxaccount_template_id,
-                 'url' => '',
-                 'data' => [
-                     'keyword1' => $name,
-                     'keyword2' => $content,
-                     'keyword3' => date('Y-m-d H:i'),
-                 ],
-                 'miniprogram' => [
-                     'appid' => $weChatApp->app_id,
-                     'pagepath' => 'pages/sell/sell'
-                 ],
-             ]);*/
+           /* $app = Factory::officialAccount($config);
+            $res = $app->template_message->send([
+                'touser' => $g_open_id,
+                'template_id' => $weChatApp->wxaccount_template_id,
+                'url' => '',
+                'data' => [
+                    'keyword1' => $name,
+                    'keyword2' => $content,
+                    'keyword3' => date('Y-m-d H:i'),
+                ],
+                'miniprogram' => [
+                    'appid' => $weChatApp->app_id,
+                    'pagepath' => 'pages/sell/sell'
+                ],
+            ]);*/
             return $res;
         } else {
             return false;
@@ -2004,7 +1988,7 @@ class AlbumController extends Controller
     public function albumAddAgent(Request $request)
     {
         $userAuth = Auth('api')->user();
-        if(!$userAuth) return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '未登录!');
+
         $validator = Validator::make($request->all(), [
             'realname' => 'required',
             'address' => 'required',
@@ -2096,7 +2080,7 @@ class AlbumController extends Controller
     public function albumGetAgentAdress(Request $request)
     {
         $userAuth = Auth('api')->user();
-        if(!$userAuth) return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '未登录!');
+
         $validator = Validator::make($request->all(), [
             'store_id' => 'required',
         ],[
@@ -2156,8 +2140,6 @@ class AlbumController extends Controller
 
     public function albumGetBanner(Request $request)
     {
-        $userAuth = Auth('api')->user();
-        if(!$userAuth) return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '未登录!');
         $validator = Validator::make($request->all(), [
             'store_id' => 'required',
         ],[
@@ -2211,7 +2193,7 @@ class AlbumController extends Controller
     public function albumGetCustomer(Request $request)
     {
         $userAuth = Auth('api')->user();
-        if(!$userAuth) return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '未登录!');
+
         $validator = Validator::make($request->all(), [
             'store_id' => 'required',
             'open_id'=>'required'
@@ -2283,7 +2265,7 @@ class AlbumController extends Controller
     public function albumSetCustomer(Request $request)
     {
         $userAuth = Auth('api')->user();
-        if(!$userAuth) return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '未登录!');
+
         $validator = Validator::make($request->all(), [
             'store_id' => 'required',
             'key' => 'required',
@@ -2361,7 +2343,7 @@ class AlbumController extends Controller
     public function albumCustomerGoods(Request $request)
     {
         $userAuth = Auth('api')->user();
-        if(!$userAuth) return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '未登录!');
+
         $validator = Validator::make($request->all(), [
             'store_id' => 'required',
             'open_id' => 'required',
@@ -2443,9 +2425,7 @@ class AlbumController extends Controller
     public function albumCustomerGoodsDetail(Request $request)
     {
         $userAuth = Auth('api')->user();
-        if (!$userAuth) {
-            return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '未登录!');
-        }
+
         $validator = Validator::make($request->all(), [
             'store_id' => 'required',
             'open_id' => 'required',
@@ -2559,7 +2539,7 @@ class AlbumController extends Controller
     public function albumGetCountOfFavorite(Request $request)
     {
         $userAuth = Auth('api')->user();
-        if(!$userAuth) return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '未登录!');
+
         $validator = Validator::make($request->all(), [
             'store_id' => 'required',
         ],[
@@ -2628,7 +2608,7 @@ class AlbumController extends Controller
     public function albumGetUserInfo(Request $request)
     {
         $userAuth = Auth('api')->user();
-        if(!$userAuth) return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '未登录!');
+
         if($userAuth->is_dealer == 1){
             $user_agent = AlbumAgentModel::where([['user_id',$userAuth->id],['status',1]])->first();
             $agent_id = $user_agent['id'];
@@ -2671,7 +2651,7 @@ class AlbumController extends Controller
     public function albumStatistical(Request $request)
     {
         $userAuth = Auth('api')->user();
-        if(!$userAuth) return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '未登录!');
+
         $validator = Validator::make($request->all(), [
             'store_id' => 'required',
         ],[
@@ -2750,7 +2730,7 @@ class AlbumController extends Controller
     public function albumGetStatistical(Request $request)
     {
         $userAuth = Auth('api')->user();
-        if(!$userAuth) return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '未登录!');
+
         $validator = Validator::make($request->all(), [
             'store_id' => 'required',
             'open_id' => 'required',
@@ -2850,7 +2830,7 @@ class AlbumController extends Controller
     public function albumAgentPriceSet(Request $request)
     {
         $userAuth = Auth('api')->user();
-        if(!$userAuth) return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '未登录!');
+
         $validator = Validator::make($request->all(), [
             'is_show_ma_price' => 'required',
             'store_id' => 'required',
@@ -2870,7 +2850,7 @@ class AlbumController extends Controller
         $user_agent->save();
 
 
-        $product = AlbumProductModel::where('store_id',$data['store_id'])->get(['id','ma_price']);
+        $product = AlbumProductModel::where('store_id',$data['store_id'])->get(['id','cat_id','name','ma_price']);
         foreach ($product as $key=>$val) {
             $save['price'] = $val['ma_price'] * (1 + $data['point'] / 100);
             $check = AlbumProductPriceModel::where([['agent_id',$user_agent->id],['store_id',$data['store_id']],['product_id',$val['id']]])->first();

+ 182 - 110
app/Http/Controllers/Api/V1/AlbumPosterController.php

xqd xqd xqd xqd xqd xqd xqd xqd xqd
@@ -61,9 +61,7 @@ class AlbumPosterController extends Controller
     public function posterInfo(Request $request)
     {
         $userAuth = Auth('api')->user();
-        if (!$userAuth) {
-            return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '未登录!');
-        }
+
         $validator = Validator::make($request->all(), [
             'store_id' => 'required',
         ], [
@@ -73,19 +71,17 @@ class AlbumPosterController extends Controller
             return $this->validatorError($validator->messages()->all(), ErrorCode::CLIENT_WRONG_PARAMS, '');
         }
         $store_id = $request->input('store_id');
-        $info = AlbumPosterModel::where('store_id', $store_id)->first()->toArray();
+        $info = AlbumPosterModel::where('store_id', $store_id)->get();
         $WeChatApp = AlbumManufacturerModel::where('store_id', $store_id)->first();
         if ($userAuth->is_dealer != 1) {
             if ($userAuth->up_agent_id == 0) {
                 $name = $WeChatApp->name;
-                $phone = $WeChatApp->phone;
             } else {
                 $agent_check = AlbumAgentModel::where([
                     ['store_id',$store_id],
                     ['id',$userAuth->up_agent_id]
                 ])->first();
                 $name = $agent_check->realname;
-                $phone = $agent_check->phone;
             }
         } else {
             $agent_check = AlbumAgentModel::where([
@@ -93,96 +89,32 @@ class AlbumPosterController extends Controller
                 ['user_id',$userAuth->id]
             ])->first();
             $name = $agent_check->realname;
-            $phone = $agent_check->phone;
-        }
-        $info['phone'] = $phone;
-        $info['username'] = $name;
-        return $this->api(compact('info'));
-    }
-
-    private function getQrCode($appId, $appSecret, $store_id)
-    {
-        $access = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=$appId&secret=$appSecret";
-        $res_access = $this->curlGet($access);
-        $res_access = json_decode($res_access, true);
-        if (isset($res_access['access_token'])) {
-            $ACCESS_TOKEN = $res_access['access_token'];
-            $url = "https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=" . $ACCESS_TOKEN;
-            $data = array();
-            $data['scene'] = "scene";//自定义信息,可以填写诸如识别用户身份的字段,注意用中文时的情况
-            $data['page'] = "pages/index/index";//扫描后对应的path
-            $data['width'] = 800;//自定义的尺寸
-            $data['auto_color'] = false;//是否自定义颜色
-            $color = array(
-                "r" => "0",
-                "g" => "0",
-                "b" => "0",
-            );
-            $data['line_color'] = $color;//自定义的颜色值
-            //dd($data,$url);
-            $data = json_encode($data);
-            $this->getHttpArray($url, $data, $store_id);
-            return true;
-        } else {
-            \Log::error($res_access);
-            return false;
         }
+        $datas['info'] = $info;
+        $datas['username'] = $name;
+        $datas['avatar'] = $userAuth->avatar;
+        $datas['share'] = $WeChatApp->share_image;
+        $datas['title'] = $WeChatApp->share_title;
+        $datas['personalQrcode'] = $this->createPosterPersonal($WeChatApp, $store_id);
+        $datas['qrcode'] = $this->createPoster($userAuth, $store_id);
+        return $this->api(compact('datas'));
     }
 
     /**
-     * 获取小程序码 EasyWeChat
-     * @param $appId string
-     * @param $appSecret string
-     * @param $agent_id int
-     * @param $store_id int
-     * @param $user_id int
-     * @return bool|string
-     * @throws \EasyWeChat\Kernel\Exceptions\InvalidArgumentException
-     */
-    private function getQrCodeEasy($appId, $appSecret, $agent_id, $store_id, $user_id)
-    {
-        $config = [
-            'app_id' => $appId,
-            'secret' => $appSecret,
-            'response_type' => 'array',
-        ];
-        $app = Factory::miniProgram($config);
-        $response = $app->app_code->get('pages/index/index?agentid=' . $agent_id, [
-            'width' => 140,
-        ]);
-
-        if ($response instanceof \EasyWeChat\Kernel\Http\StreamResponse) {
-            if (!file_exists(public_path() . '/base/poster/QrCode/' . $store_id)) {
-                mkdir(public_path() . '/base/poster/QrCode/' . $store_id, 0755, true);
-            }
-            $filename = $response->saveAs(public_path() . '/base/poster/QrCode/' . $store_id . "/", "$user_id.png");
-            if ($filename) {
-                return public_path() . "/base/poster/QrCode/" . $store_id . "/$user_id.png";
-            } else {
-                return false;
-            }
-        } else {
-            return false;
-        }
-    }
-
-    /**
-     * @api {post} /api/album_post/create 生成海报(create)
-     * @apiDescription 生成海报(create)
+     * @api {post} /api/album_post/download 下载海报(download)
+     * @apiDescription 生成海报(download)
      * @apiGroup Album_Post
      * @apiPermission 需要登录
      * @apiVersion 0.1.0
      * @apiParam {int}    [store_id]  商户id
-     * @apiParam {string}    [image]  图片
+     * @apiParam {int}    [poster_id]  海报id
      * @apiSuccessExample {json} Success-Response:
      * HTTP/1.1 200 OK
      * {
      *     "status": true,
      *     "status_code": 0,
      *     "message": "",
-     *     "data": [
-     *           'real_url':'asdawd',  //海报
-     *      ]
+     *     "data": []
      * }
      * @apiErrorExample {json} Error-Response:
      * HTTP/1.1 400 Bad Request
@@ -195,28 +127,20 @@ class AlbumPosterController extends Controller
      * 可能出现的错误代码:
      *    1000    CLIENT_WRONG_PARAMS             传入参数不正确
      */
-    public function createPoster(Request $request)
+    public function posterDownload(Request $request)
     {
         $userAuth = Auth('api')->user();
-        if (!$userAuth) {
-            return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '未登录!');
-        }
+
         $validator = Validator::make($request->all(), [
             'store_id' => 'required',
-            'image' => 'required',
+            'poster_id' => 'required',
         ], [
             'store_id.required' => '店铺信息未知',
-            'image' => '缺少图片链接'
+            'poster_id.required' => '缺少图片链接'
         ]);
         if ($validator->fails()) {
             return $this->validatorError($validator->messages()->all(), ErrorCode::CLIENT_WRONG_PARAMS, '');
         }
-        if ($userAuth->is_dealer == 1) {
-            $user_agent = AlbumAgentModel::where([['user_id',$userAuth->id],['status',1]])->first();
-            $agent_id = $user_agent['id'];
-        } else {
-            $agent_id = $userAuth->up_agent_id == 0 ? 0 : $userAuth->up_agent_id;
-        }
 
         $data = $request->input();
 
@@ -229,31 +153,59 @@ class AlbumPosterController extends Controller
             $user_agent = AlbumAgentModel::where('id', $userAuth->up_agent_id)->first();
             $user_agent->share_times++;
             $user_agent->save();
-            //$album = new AlbumController();
-            //$album->sendLogsMessage($data['store_id'], $agent->open_id, 9, $userAuth->username, $agent->g_open_id);
+
+
 
             AlbumWatchRecord::create($add_record);
         }
 
-        $info = AlbumPosterModel::where('store_id', $data['store_id'])->first()->toArray();
+        AlbumPosterModel::where([['id', $data['poster_id']],['store_id', $data['store_id']]])->increment('downloadNum');
+
+        return $this->api([]);
+    }
+
+    Private function createPosterPersonal($WeChatApp, $store_id)
+    {
+
+        $userAuth = Auth('api')->user();
+        if (file_exists(public_path() . '/download/' . $userAuth->id . '_personal.png')) {
+            unlink(public_path() . '/download/' . $userAuth->id . '_personal.png');
+        }
+        if ($userAuth->is_dealer == 1) {
+            $user_agent = AlbumAgentModel::where([['user_id',$userAuth->id],['status',1]])->first();
+            $agent_id = $user_agent['id'];
+        } else {
+            $agent_id = $userAuth->up_agent_id == 0 ? 0 : $userAuth->up_agent_id;
+        }
+        if ($userAuth->up_agent_id != 0) {
+            $add_record['agent_id'] = $userAuth->up_agent_id;
+            $add_record['open_id'] = $userAuth->open_id;
+            $add_record['action'] = 9;
+            $add_record['store_id'] = $store_id;
+            $add_record['detail'] = '保存了图片';
+            $user_agent = AlbumAgentModel::where('id', $userAuth->up_agent_id)->first();
+            $user_agent->share_times++;
+            $user_agent->save();
+            AlbumWatchRecord::create($add_record);
+        }
         $editor = Grafika::createEditor();
         $editor->open($image_poster, public_path() . '/base/poster/img/poster_canvas.png');
-        $editor->open($image_poduct, str_replace(env('CDN_URL'), public_path(), $data['image']));
+        $editor->open($image_poduct, str_replace(env('CDN_URL'), public_path(), $WeChatApp->circleOfFriends));
         $editor->resizeExactWidth($image_poduct, 440);
         $editor->resizeExactHeight($image_poduct, 440);
         $editor->blend($image_poster, $image_poduct, 'normal', 1, 'top-left', 10, 10);
         $font_bold = public_path() . '/base/poster/font/msyhbd.ttc';
         $font = public_path() . '/base/poster/font/msyh.ttc';
         for ($i = 0; $i <= 1; $i++) {
-            $len = mb_strlen($info['introduce']);
+            $len = mb_strlen($WeChatApp->introduce);
             if ($len <= 17) {
-                $editor->text($image_poster, $info['introduce'], 19, 10, 460, new Color("#000000"), $font_bold, 0);
+                $editor->text($image_poster, $WeChatApp->introduce, 19, 10, 460, new Color("#000000"), $font_bold, 0);
                 break;
             }
             if ($i == 0) {
-                $text = mb_substr($info['introduce'], $i * 17, 17);
+                $text = mb_substr($WeChatApp->introduce, $i * 17, 17);
             } else {
-                $text = mb_substr($info['introduce'], $i * 17, ($len - 17) > 10 ? 10 : ($len - 17));
+                $text = mb_substr($WeChatApp->introduce, $i * 17, ($len - 17) > 10 ? 10 : ($len - 17));
             }
             $editor->text($image_poster, $text, 19, 10, 460 + 50 * $i, new Color("#000000"), $font_bold, 0);
         }
@@ -261,14 +213,14 @@ class AlbumPosterController extends Controller
         $editor->resizeExactWidth($image_icon, 40);
         $editor->resizeExactHeight($image_icon, 40);
         $editor->blend($image_poster, $image_icon, 'normal', 1, 'top-left', 10, 570);
-        $WeChatApp = AlbumManufacturerModel::where('store_id', $data['store_id'])->first();
+
         if ($userAuth->is_dealer != 1) {
             if ($userAuth->up_agent_id == 0) {
                 $name = $WeChatApp->name;
                 $phone = $WeChatApp->phone;
             } else {
                 $agent_check = AlbumAgentModel::where([
-                    ['store_id',$data['store_id']],
+                    ['store_id',$store_id],
                     ['id',$userAuth->up_agent_id]
                 ])->first();
                 $name = $agent_check->realname;
@@ -276,7 +228,7 @@ class AlbumPosterController extends Controller
             }
         } else {
             $agent_check = AlbumAgentModel::where([
-                ['store_id',$data['store_id']],
+                ['store_id',$store_id],
                 ['user_id',$userAuth->id]
             ])->first();
             $name = $agent_check->realname;
@@ -285,11 +237,11 @@ class AlbumPosterController extends Controller
         $editor->text($image_poster, $phone, 20, 55, 577, new Color("#eb7a48"), $font, 0);
         $editor->text($image_poster, '长按识别二维码 展示家具画册', 16, 10, 650, new Color("#666666"), $font, 0);
         if ($agent_id == 0) {
-            $editor->open($image_qrcode, str_replace(env('CDN_URL'), public_path(), $info['qrcode']));
+            $editor->open($image_qrcode, str_replace(env('CDN_URL'), public_path(), $WeChatApp->qrcode));
             $editor->resizeExactWidth($image_qrcode, 140);
             $editor->resizeExactHeight($image_qrcode, 140);
         } else {
-            $file = $this->getQrCodeEasy($WeChatApp->xyx_id, $WeChatApp->xyx_secret, $agent_id, $data['store_id'], $userAuth->id);
+            $file = $this->getQrCodeEasy($WeChatApp->xyx_id, $WeChatApp->xyx_secret, $agent_id, $store_id, $userAuth->id);
             if (!$file) {
                 return $this->error(0, '参数错误,请检查配置', []);
             }
@@ -299,18 +251,138 @@ class AlbumPosterController extends Controller
         }
 
         $editor->blend($image_poster, $image_qrcode, 'normal', 1, 'top-left', 310, 500);
-        $editor->open($image_avatar, public_path() . '/base/poster/avatar/' . $data['store_id'] . "/$userAuth->id.jpg");
+        $editor->open($image_avatar, public_path() . '/base/poster/avatar/' . $store_id . "/$userAuth->id.jpg");
         $editor->resizeExactWidth($image_avatar, 64);
         $editor->resizeExactHeight($image_avatar, 64);
         $editor->blend($image_poster, $image_avatar, 'normal', 1, 'top-left', 348, 538);
         $editor->text($image_poster, $name, 16, 380 - (22 * (mb_strlen($name) / 2)), 650, new Color("#666666"), $font, 0);
-        $editor->save($image_poster, public_path() . '/download/' . $userAuth->id . '.png');
+        $editor->save($image_poster, public_path() . '/download/' . $userAuth->id . '_personal.png');
+        $real_url = env('CDN_URL') . '/download/' . $userAuth->id . '_personal.png';
+        return $real_url;
+    }
+
+
+    private function getQrCode($appId, $appSecret, $store_id)
+    {
+        $access = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=$appId&secret=$appSecret";
+        $res_access = $this->curlGet($access);
+        $res_access = json_decode($res_access, true);
+        if (isset($res_access['access_token'])) {
+            $ACCESS_TOKEN = $res_access['access_token'];
+            $url = "https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=" . $ACCESS_TOKEN;
+            $data = array();
+            $data['scene'] = "scene";//自定义信息,可以填写诸如识别用户身份的字段,注意用中文时的情况
+            $data['page'] = "pages/index/index";//扫描后对应的path
+            $data['width'] = 800;//自定义的尺寸
+            $data['auto_color'] = false;//是否自定义颜色
+            $color = array(
+                "r" => "0",
+                "g" => "0",
+                "b" => "0",
+            );
+            $data['line_color'] = $color;//自定义的颜色值
+            //dd($data,$url);
+            $data = json_encode($data);
+            $this->getHttpArray($url, $data, $store_id);
+            return true;
+        } else {
+            \Log::error($res_access);
+            return false;
+        }
+    }
+
+    /**
+     * 获取小程序码 EasyWeChat
+     * @param $appId string
+     * @param $appSecret string
+     * @param $agent_id int
+     * @param $store_id int
+     * @param $user_id int
+     * @return bool|string
+     * @throws \EasyWeChat\Kernel\Exceptions\InvalidArgumentException
+     */
+    private function getQrCodeEasy($appId, $appSecret, $agent_id, $store_id, $user_id)
+    {
+        $config = [
+            'app_id' => $appId,
+            'secret' => $appSecret,
+            'response_type' => 'array',
+        ];
+        $app = Factory::miniProgram($config);
+        $response = $app->app_code->get('pages/index/index?agentid=' . $agent_id, [
+            'width' => 140,
+        ]);
+
+        if ($response instanceof \EasyWeChat\Kernel\Http\StreamResponse) {
+            if (!file_exists(public_path() . '/base/poster/QrCode/' . $store_id)) {
+                mkdir(public_path() . '/base/poster/QrCode/' . $store_id, 0755, true);
+            }
+            $filename = $response->saveAs(public_path() . '/base/poster/QrCode/' . $store_id . "/", "$user_id.png");
+            if ($filename) {
+                return public_path() . "/base/poster/QrCode/" . $store_id . "/$user_id.png";
+            } else {
+                return false;
+            }
+        } else {
+            return false;
+        }
+    }
+
+    private function createPoster($userAuth, $store_id)
+    {
+        if ($userAuth->is_dealer == 1) {
+            $user_agent = AlbumAgentModel::where([['user_id',$userAuth->id],['status',1]])->first();
+            $agent_id = $user_agent['id'];
+        } else {
+            $agent_id = $userAuth->up_agent_id == 0 ? 0 : $userAuth->up_agent_id;
+        }
+        if (file_exists(public_path() . '/download/' . $userAuth->id . '.png')) {
+            unlink(public_path() . '/download/' . $userAuth->id . '.png');
+        }
+
+        if ($userAuth->up_agent_id != 0) {
+            $add_record['agent_id'] = $userAuth->up_agent_id;
+            $add_record['open_id'] = $userAuth->open_id;
+            $add_record['action'] = 9;
+            $add_record['store_id'] = $store_id;
+            $add_record['detail'] = '保存了图片';
+            $user_agent = AlbumAgentModel::where('id', $userAuth->up_agent_id)->first();
+            $user_agent->share_times++;
+            $user_agent->save();
+            //$album = new AlbumController();
+            //$album->sendLogsMessage($data['store_id'], $agent->open_id, 9, $userAuth->username, $agent->g_open_id);
+
+            AlbumWatchRecord::create($add_record);
+        }
+
+        $editor = Grafika::createEditor();
+
+        $WeChatApp = AlbumManufacturerModel::where('store_id', $store_id)->first();
+
+        if ($agent_id == 0) {
+            $editor->open($image_qrcode, str_replace(env('CDN_URL'), public_path(), $WeChatApp->qrcode));
+            $editor->resizeExactWidth($image_qrcode, 430);
+            $editor->resizeExactHeight($image_qrcode, 430);
+        } else {
+            $file = $this->getQrCodeEasy($WeChatApp->xyx_id, $WeChatApp->xyx_secret, $agent_id, $store_id, $userAuth->id);
+            if (!$file) {
+                return $this->error(0, '参数错误,请检查配置', []);
+            }
+            $editor->open($image_qrcode, $file);
+            $editor->resizeExactWidth($image_qrcode, 430);
+            $editor->resizeExactHeight($image_qrcode, 430);
+        }
+        $editor->open($image_avatar, public_path() . '/base/poster/avatar/' . $store_id . "/$userAuth->id.jpg");
+        $editor->resizeExactWidth($image_avatar, 190);
+        $editor->resizeExactHeight($image_avatar, 190);
+        $editor->blend($image_qrcode, $image_avatar, 'normal', 1, 'top-left', 120, 120);
+        $editor->save($image_qrcode, public_path() . '/download/' . $userAuth->id . '.png');
         $real_url = env('CDN_URL') . '/download/' . $userAuth->id . '.png';
         return $this->api(compact('real_url'));
     }
 
     /**
-     * @api {post} /api/album_post/del 删除海报(del)
+     * @api {post} /api/album_post/del 删除海报(del) 已废弃
      * @apiDescription 删除海报(del)
      * @apiGroup Album_Post
      * @apiPermission 需要登录

+ 53 - 53
app/Http/Controllers/Api/V1/FurnitureController.php

xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd xqd
@@ -38,7 +38,7 @@ class FurnitureController extends Controller
 
 
     /**
-     * @api {post} /api/furnitureWe7/setting 首页基本设置
+     * @api {post} /api/furniture/setting 首页基本设置
      * @apiDescription   首页基本设置
      * @apiGroup Furniture
      * @apiPermission none
@@ -160,7 +160,7 @@ class FurnitureController extends Controller
 
 
     /**
-     * @api {get} /api/furnitureWe7/news_detail 获取新闻详情
+     * @api {get} /api/furniture/news_detail 获取新闻详情
      * @apiDescription 获取新闻详情(news_detail)
      * @apiGroup Furniture
      * @apiPermission none
@@ -208,12 +208,12 @@ class FurnitureController extends Controller
      *                  "replys": {
      *                      "current_page": 1,
      *                      "data": [],
-     *                      "first_page_url": "http://localhost:8082/api/furnitureWe7/news_detail?page=1",
+     *                      "first_page_url": "http://localhost:8082/api/furniture/news_detail?page=1",
      *                      "from": null,
      *                      "last_page": 1,
-     *                      "last_page_url": "http://localhost:8082/api/furnitureWe7/news_detail?page=1",
+     *                      "last_page_url": "http://localhost:8082/api/furniture/news_detail?page=1",
      *                      "next_page_url": null,
-     *                      "path": "http://localhost:8082/api/furnitureWe7/news_detail",
+     *                      "path": "http://localhost:8082/api/furniture/news_detail",
      *                      "per_page": 5,
      *                      "prev_page_url": null,
      *                      "to": null,
@@ -221,12 +221,12 @@ class FurnitureController extends Controller
      * }
      * }
      * ],
-     * "first_page_url": "http://localhost:8082/api/furnitureWe7/news_detail?page=1",
+     * "first_page_url": "http://localhost:8082/api/furniture/news_detail?page=1",
      * "from": 1,
      * "last_page": 1,
-     * "last_page_url": "http://localhost:8082/api/furnitureWe7/news_detail?page=1",
+     * "last_page_url": "http://localhost:8082/api/furniture/news_detail?page=1",
      * "next_page_url": null,
-     * "path": "http://localhost:8082/api/furnitureWe7/news_detail",
+     * "path": "http://localhost:8082/api/furniture/news_detail",
      * "per_page": 5,
      * "prev_page_url": null,
      * "to": 1,
@@ -273,7 +273,7 @@ class FurnitureController extends Controller
 
 
     /**
-     * @api {get} /api/furnitureWe7/news_list 获取新闻列表
+     * @api {get} /api/furniture/news_list 获取新闻列表
      * @apiDescription 获取新闻列表(news_list)
      * @apiGroup Furniture
      * @apiPermission none
@@ -305,12 +305,12 @@ class FurnitureController extends Controller
      *                  },
      *...
      *          ],
-     *      "first_page_url": "http://s1.xcx.com/api/furnitureWe7/news_list?page=1",       //首页url
+     *      "first_page_url": "http://s1.xcx.com/api/furniture/news_list?page=1",       //首页url
      *      "from": 1,
      *      "last_page": 1,
-     *      "last_page_url": "http://s1.xcx.com/api/furnitureWe7/news_list?page=1",        //尾页url
+     *      "last_page_url": "http://s1.xcx.com/api/furniture/news_list?page=1",        //尾页url
      *      "next_page_url": null,                                                      //下一页url
-     *      "path": "http://s1.xcx.com/api/furnitureWe7/news_list",
+     *      "path": "http://s1.xcx.com/api/furniture/news_list",
      *      "per_page": 5,
      *      "prev_page_url": null,                                                     //上一页url
      *      "to": 3,
@@ -348,7 +348,7 @@ class FurnitureController extends Controller
     }
 
     /**
-     * @api {get} /api/furnitureWe7/add_comments 添加新闻评论
+     * @api {get} /api/furniture/add_comments 添加新闻评论
      * @apiDescription 添加新闻评论(news_list)
      * @apiGroup Furniture
      * @apiPermission Passport
@@ -405,7 +405,7 @@ class FurnitureController extends Controller
     }
 
     /**
-     * @api {get} /api/furnitureWe7/addtolike 新闻点赞
+     * @api {get} /api/furniture/addtolike 新闻点赞
      * @apiDescription 新闻点赞
      * @apiGroup Furniture
      * @apiPermission None
@@ -465,7 +465,7 @@ class FurnitureController extends Controller
     }
 
     /**
-     * @api {get} /api/furnitureWe7/getmorecomments 获取全部评论/回复
+     * @api {get} /api/furniture/getmorecomments 获取全部评论/回复
      * @apiDescription 获取全部评论/回复(getmorecomments)
      * @apiGroup Furniture
      * @apiPermission none
@@ -512,12 +512,12 @@ class FurnitureController extends Controller
      *                  "replys": {
      *                      "current_page": 1,
      *                      "data": [],
-     *                      "first_page_url": "http://localhost:8082/api/furnitureWe7/news_detail?page=1",
+     *                      "first_page_url": "http://localhost:8082/api/furniture/news_detail?page=1",
      *                      "from": null,
      *                      "last_page": 1,
-     *                      "last_page_url": "http://localhost:8082/api/furnitureWe7/news_detail?page=1",
+     *                      "last_page_url": "http://localhost:8082/api/furniture/news_detail?page=1",
      *                      "next_page_url": null,
-     *                      "path": "http://localhost:8082/api/furnitureWe7/news_detail",
+     *                      "path": "http://localhost:8082/api/furniture/news_detail",
      *                      "per_page": 5,
      *                      "prev_page_url": null,
      *                      "to": null,
@@ -525,12 +525,12 @@ class FurnitureController extends Controller
      * }
      * }
      * ],
-     * "first_page_url": "http://localhost:8082/api/furnitureWe7/news_detail?page=1",
+     * "first_page_url": "http://localhost:8082/api/furniture/news_detail?page=1",
      * "from": 1,
      * "last_page": 1,
-     * "last_page_url": "http://localhost:8082/api/furnitureWe7/news_detail?page=1",
+     * "last_page_url": "http://localhost:8082/api/furniture/news_detail?page=1",
      * "next_page_url": null,
-     * "path": "http://localhost:8082/api/furnitureWe7/news_detail",
+     * "path": "http://localhost:8082/api/furniture/news_detail",
      * "per_page": 5,
      * "prev_page_url": null,
      * "to": 1,
@@ -580,7 +580,7 @@ class FurnitureController extends Controller
 
 
     /**
-     * @api {get} /api/furnitureWe7/newgoods_list 新品发布列表
+     * @api {get} /api/furniture/newgoods_list 新品发布列表
      * @apiDescription 获取新品发布列表(news_list)
      * @apiGroup Furniture
      * @apiPermission none
@@ -610,12 +610,12 @@ class FurnitureController extends Controller
      *          "comments_total": 2,                  //评价总量
      *      }
      *      ],
-     *      "first_page_url": "http://local.furniture.com/api/furnitureWe7/newgoods_list?page=1",
+     *      "first_page_url": "http://local.furniture.com/api/furniture/newgoods_list?page=1",
      *      "from": 1,
      *      "last_page": 1,
-     *      "last_page_url": "http://local.furniture.com/api/furnitureWe7/newgoods_list?page=1",
+     *      "last_page_url": "http://local.furniture.com/api/furniture/newgoods_list?page=1",
      *      "next_page_url": null,
-     *      "path": "http://local.furniture.com/api/furnitureWe7/newgoods_list",
+     *      "path": "http://local.furniture.com/api/furniture/newgoods_list",
      *      "per_page": 10,
      *      "prev_page_url": null,
      *      "to": 1,
@@ -656,7 +656,7 @@ class FurnitureController extends Controller
 
 
     /**
-     * @api {get} /api/furnitureWe7/newgoods_index 新品发布详情
+     * @api {get} /api/furniture/newgoods_index 新品发布详情
      * @apiDescription 获取新品发布详情(news_index)
      * @apiGroup Furniture
      * @apiPermission none
@@ -755,7 +755,7 @@ class FurnitureController extends Controller
 
 
     /**
-     * @api {post} /api/furnitureWe7/newgoods_addcomment 新品发布添加评论
+     * @api {post} /api/furniture/newgoods_addcomment 新品发布添加评论
      * @apiDescription 添加评论(newgoods_addcomment)
      * @apiGroup Furniture
      * @apiPermission passport
@@ -839,7 +839,7 @@ class FurnitureController extends Controller
     }
 
     /**
-     * @api {post} /api/furnitureWe7/newgoods_addbooking 新品发布添加预售
+     * @api {post} /api/furniture/newgoods_addbooking 新品发布添加预售
      * @apiDescription 添加预售(newgoods_addbooking)
      * @apiGroup Furniture
      * @apiPermission passport
@@ -915,7 +915,7 @@ class FurnitureController extends Controller
     }
 
     /**
-     * @api {get} /api/furnitureWe7/goods_list 获取产品列表
+     * @api {get} /api/furniture/goods_list 获取产品列表
      * @apiDescription 获取产品列表(goods_list)
      * @apiGroup Furniture
      * @apiPermission none
@@ -945,12 +945,12 @@ class FurnitureController extends Controller
      *              }
      * ...
      *          ],
-     *          "first_page_url": "http://s1.xcx.com/api/furnitureWe7/goods_list?page=1",
+     *          "first_page_url": "http://s1.xcx.com/api/furniture/goods_list?page=1",
      *          "from": 1,
      *          "last_page": 1,
-     *          "last_page_url": "http://s1.xcx.com/api/furnitureWe7/goods_list?page=1",
+     *          "last_page_url": "http://s1.xcx.com/api/furniture/goods_list?page=1",
      *          "next_page_url": null,
-     *          "path": "http://s1.xcx.com/api/furnitureWe7/goods_list",
+     *          "path": "http://s1.xcx.com/api/furniture/goods_list",
      *          "per_page": 5,
      *          "prev_page_url": null,
      *          "to": 4,
@@ -990,7 +990,7 @@ class FurnitureController extends Controller
 
 
     /**
-     * @api {post} /api/furnitureWe7/service_login 登陆(login)
+     * @api {post} /api/furniture/service_login 登陆(login)
      * @apiDescription 登陆(login)
      * @apiGroup Furniture_Service
      * @apiPermission none
@@ -1132,7 +1132,7 @@ class FurnitureController extends Controller
     }
 
     /**
-     * @api {get} /api/furnitureWe7/getfurnitureads 获取首页广告
+     * @api {get} /api/furniture/getfurnitureads 获取首页广告
      * @apiDescription 获取首页广告
      * @apiGroup Furniture_Service
      * @apiPermission none
@@ -1179,7 +1179,7 @@ class FurnitureController extends Controller
     }
 
     /**
-     * @api {get} /api/furnitureWe7/getattr 获取产品属性
+     * @api {get} /api/furniture/getattr 获取产品属性
      * @apiDescription 获取产品属性
      * @apiGroup Furniture_Service
      * @apiPermission none
@@ -1228,7 +1228,7 @@ class FurnitureController extends Controller
     }
 
     /**
-     * @api {post} /api/furnitureWe7/createorder 创建售后订单
+     * @api {post} /api/furniture/createorder 创建售后订单
      * @apiDescription 创建售后订单
      * @apiGroup Furniture_Service
      * @apiPermission Passport
@@ -1322,7 +1322,7 @@ class FurnitureController extends Controller
 
 
     /**
-     * @api {get} /api/furnitureWe7/getorder 获取订单信息
+     * @api {get} /api/furniture/getorder 获取订单信息
      * @apiDescription 获取订单
      * @apiGroup Furniture_Service
      * @apiPermission none
@@ -1366,12 +1366,12 @@ class FurnitureController extends Controller
      *          }
      * ...
      *      ],
-     *                  "first_page_url": "http://s1.xcx.com/api/furnitureWe7/getorder?page=1",
+     *                  "first_page_url": "http://s1.xcx.com/api/furniture/getorder?page=1",
      *                  "from": 1,
      *                  "last_page": 1,
-     *                  "last_page_url": "http://s1.xcx.com/api/furnitureWe7/getorder?page=1",
+     *                  "last_page_url": "http://s1.xcx.com/api/furniture/getorder?page=1",
      *                  "next_page_url": null,
-     *                  "path": "http://s1.xcx.com/api/furnitureWe7/getorder",
+     *                  "path": "http://s1.xcx.com/api/furniture/getorder",
      *                  "per_page": 5,
      *                  "prev_page_url": null,
      *                  "to": 2,
@@ -1459,7 +1459,7 @@ class FurnitureController extends Controller
     }
 
     /**
-     * @api {get} /api/furnitureWe7/getorderdetail 获取订单详情
+     * @api {get} /api/furniture/getorderdetail 获取订单详情
      * @apiDescription 获取订单详情
      * @apiGroup Furniture_Service
      * @apiPermission Passport
@@ -1563,7 +1563,7 @@ class FurnitureController extends Controller
     }
 
     /**
-     * @api {get} /api/furnitureWe7/getprogress 订单进度统计
+     * @api {get} /api/furniture/getprogress 订单进度统计
      * @apiDescription 订单进度统计
      * @apiGroup Furniture_Service
      * @apiPermission none
@@ -1731,7 +1731,7 @@ class FurnitureController extends Controller
 
 
     /**
-     * @api {get} /api/furnitureWe7/getreviewcount 评价统计
+     * @api {get} /api/furniture/getreviewcount 评价统计
      * @apiDescription 评价统计
      * @apiGroup Furniture_Service
      * @apiPermission none
@@ -1814,7 +1814,7 @@ class FurnitureController extends Controller
     }
 
     /**
-     * @api {get} /api/furnitureWe7/ordercount 按产品/品类统计
+     * @api {get} /api/furniture/ordercount 按产品/品类统计
      * @apiDescription 按产品/品类统计
      * @apiGroup Furniture_Service
      * @apiPermission none
@@ -1920,7 +1920,7 @@ class FurnitureController extends Controller
 
 
     /**
-     * @api {get} /api/furnitureWe7/searchlist  产品订单搜索列表页
+     * @api {get} /api/furniture/searchlist  产品订单搜索列表页
      * @apiDescription 产品订单搜索列表页
      * @apiGroup Furniture_Service
      * @apiPermission none
@@ -1962,12 +1962,12 @@ class FurnitureController extends Controller
      *          }
      * ...
      *      ],
-     *                  "first_page_url": "http://s1.xcx.com/api/furnitureWe7/getorder?page=1",
+     *                  "first_page_url": "http://s1.xcx.com/api/furniture/getorder?page=1",
      *                  "from": 1,
      *                  "last_page": 1,
-     *                  "last_page_url": "http://s1.xcx.com/api/furnitureWe7/getorder?page=1",
+     *                  "last_page_url": "http://s1.xcx.com/api/furniture/getorder?page=1",
      *                  "next_page_url": null,
-     *                  "path": "http://s1.xcx.com/api/furnitureWe7/getorder",
+     *                  "path": "http://s1.xcx.com/api/furniture/getorder",
      *                  "per_page": 5,
      *                  "prev_page_url": null,
      *                  "to": 2,
@@ -2020,7 +2020,7 @@ class FurnitureController extends Controller
     }
 
     /**
-     * @api {post} /api/furnitureWe7/addreview  添加评论
+     * @api {post} /api/furniture/addreview  添加评论
      * @apiDescription 添加评论
      * @apiGroup Furniture_Service
      * @apiPermission Passport
@@ -2109,7 +2109,7 @@ class FurnitureController extends Controller
     }
 
     /**
-     * @api {post} /api/furnitureWe7/updatestatus  更新订单状态
+     * @api {post} /api/furniture/updatestatus  更新订单状态
      * @apiDescription 更新订单状态
      * @apiGroup Furniture_Service
      * @apiPermission Passport
@@ -2195,7 +2195,7 @@ class FurnitureController extends Controller
     }
 
     /**
-     * @api {post} /api/furnitureWe7/getphonenumber   获取手机号
+     * @api {post} /api/furniture/getphonenumber   获取手机号
      * @apiDescription 获取手机号
      * @apiGroup Furniture_Service
      * @apiPermission none
@@ -2272,7 +2272,7 @@ class FurnitureController extends Controller
 
 
     /**
-     * @api {post} /api/furnitureWe7/printorder   打印订单
+     * @api {post} /api/furniture/printorder   打印订单
      * @apiDescription 打印订单
      * @apiGroup Furniture_Service
      * @apiPermission none
@@ -2462,7 +2462,7 @@ class FurnitureController extends Controller
     }
 
     /**
-     * @api {post} /api/furnitureWe7/saveformid   保存formid
+     * @api {post} /api/furniture/saveformid   保存formid
      * @apiDescription 保存formid
      * @apiGroup Furniture_Service
      * @apiPermission none

+ 31 - 0
app/Http/Middleware/AuthenticateApi.php

xqd
@@ -0,0 +1,31 @@
+<?php
+
+namespace App\Http\Middleware;
+
+use Closure,Auth,Response;
+
+class AuthenticateApi
+{
+    /**
+     * Handle an incoming request.
+     *
+     * @param  \Illuminate\Http\Request $request
+     * @param  \Closure $next
+     * @param  string|null $guard
+     * @return mixed
+     */
+    public function handle($request, Closure $next)
+    {
+        $userAuth = Auth('api')->user();
+        if (!$userAuth) {
+            return Response::json([
+                'status_code' => 401,
+                'message' => '请登录',
+                'data' => []
+            ], 200);
+        }
+
+        return $next($request);
+    }
+}
+

+ 14 - 2
app/Repositories/Album/Criteria/AgentWhere.php

xqd
@@ -42,11 +42,23 @@ class AgentWhere extends Criteria {
                 ->orwhere([['id','like',$keyword],['store_id',$this->store_id]])
                 ->orwhere([['address','like',$keyword],['store_id',$this->store_id]])
                 ->orwhere([['phone','like',$keyword],['store_id',$this->store_id]]);
-        } else if(isset($this->search['updated_at']) && $this->search['updated_at']) {
-            $model = $model->where('updated_at',$this->search['updated_at']);
         } else {
             $model = $model->where([['store_id',$this->store_id]]);
         }
+        if (isset($this->search['status']) && $this->search['status']) {
+            $status = $this->search['status'];
+            $model = $model->whereHas('user', function ($model) use ($status) {
+                if ($status == 3) {
+                    $model->where('is_boss', 1);
+                }
+            })->with(['user:username as nickname,is_boss']);
+            if ($status == 2) {
+                $model = $model->where([['status', 1]]);
+            }
+            if ($status == 1) {
+                $model = $model->where([['status', 0]]);
+            }
+        }
 
         return $model;
     }

+ 11 - 11
app/Repositories/Album/Criteria/CatWhere.php

xqd xqd
@@ -14,15 +14,17 @@ namespace App\Repositories\Album\Criteria;
 use App\Repositories\Base\Criteria;
 use App\Repositories\Contracts\RepositoryInterface as Repository;
 
-class CatWhere extends Criteria {
+class CatWhere extends Criteria
+{
 
     private $search = [];
     private $pid;
     private $store_id;
     /**
-     * MultiWhere constructor.
+     * CatWhere constructor.
      * @param array $search
-     *
+     * @param int $pid
+     * @param int $store_id
      */
     public function __construct(array $search,int $pid,int $store_id)
     {
@@ -33,17 +35,15 @@ class CatWhere extends Criteria {
 
     /**
      * @param $model
-     * @param RepositoryInterface $repository
-     * @return mixed
+     * @param Repository $repository
+     * @return Object
      */
     public function apply($model, Repository $repository)
     {
-        if(isset($this->search['keyword']) && $this->search['keyword']) {
-            $keyword = '%'.$this->search['keyword'].'%';
-            $model = $model->where([['name','like',$keyword],['parent_id',$this->pid],['store_id',$this->store_id]])
-                ->orwhere([['id','like',$keyword],['parent_id',$this->pid],['store_id',$this->store_id]]);
-        } else if(isset($this->search['updated_at']) && $this->search['updated_at']) {
-            $model = $model->where('updated_at',$this->search['updated_at']);
+        if (isset($this->search['keyword']) && $this->search['keyword']) {
+            $keyword = '%' . $this->search['keyword'] . '%';
+            $model = $model->where([['name','like',$keyword],['store_id',$this->store_id]])
+                ->orwhere([['id','like',$keyword],['store_id',$this->store_id]]);
         } else {
             $model = $model->where([['parent_id',0],['store_id',$this->store_id]]);
         }

+ 6 - 3
app/Repositories/Album/Criteria/MultiWhere.php

xqd
@@ -35,9 +35,12 @@ class MultiWhere extends Criteria {
     */
     public function apply($model, Repository $repository)
     {
-          if(isset($this->search['updated_at']) && $this->search['updated_at']) {
-                                    $model = $model->where('updated_at',$this->search['updated_at']);
-                                 }
+        if(isset($this->search['keyword']) && $this->search['keyword']) {
+            $keyword = '%'.$this->search['keyword'].'%';
+            $model = $model->where([['id','like',$keyword],['store_id',$this->store_id]])
+                ->orwhere([['store_id','like',$keyword],['store_id',$this->store_id]])
+                ->orwhere([['name','like',$keyword],['store_id',$this->store_id]]);
+        }
 
          return $model;
     }

+ 52 - 0
app/Repositories/Album/Criteria/PosterWhere.php

xqd
@@ -0,0 +1,52 @@
+<?php
+/**
+ * User: Mike
+ * Email: m@9026.com
+ * Date: 2017/1/12
+ * Time: 17:52
+ */
+
+namespace App\Repositories\Album\Criteria;
+
+
+
+
+use App\Repositories\Base\Criteria;
+use App\Repositories\Contracts\RepositoryInterface as Repository;
+
+class PosterWhere extends Criteria
+{
+
+    private $search = [];
+    private $store_id;
+
+    /**
+     * ProductWhere constructor.
+     * @param array $search
+     * @param int $store_id
+     */
+    public function __construct(array $search, int $store_id)
+    {
+        $this->search = $search;
+        $this->store_id = $store_id;
+    }
+
+    /**
+     * @param $model
+     * @param Repository $repository
+     * @return mixed
+     */
+    public function apply($model, Repository $repository)
+    {
+        if (isset($this->search['keyword']) && $this->search['keyword']) {
+            $keyword = '%' . $this->search['keyword'] . '%';
+            $model = $model->where([['name','like',$keyword],['store_id',$this->store_id]])
+                ->orwhere([['id','like',$keyword],['store_id',$this->store_id]]);
+        } else {
+            $model = $model->where([['store_id',$this->store_id]]);
+        }
+
+        return $model;
+    }
+
+}

+ 4 - 1
app/Repositories/Album/Criteria/PriceWhere.php

xqd xqd
@@ -11,6 +11,7 @@ namespace App\Repositories\Album\Criteria;
 
 
 
+use App\Models\AlbumProductModel;
 use App\Repositories\Base\Criteria;
 use App\Repositories\Contracts\RepositoryInterface as Repository;
 
@@ -48,7 +49,9 @@ class PriceWhere extends Criteria {
         } else {
             $model = $model->where([['store_id',$this->store_id],['agent_id',$this->agent_id]]);
         }
-
+        if (isset($this->search['cat_id']) && $this->search['cat_id'] > 0) {
+            $model = $model->where([['cat_id',$this->search['cat_id']]]);
+        }
         return $model;
     }
 

+ 5 - 6
app/Repositories/Album/Criteria/ProductWhere.php

xqd xqd xqd
@@ -14,14 +14,15 @@ namespace App\Repositories\Album\Criteria;
 use App\Repositories\Base\Criteria;
 use App\Repositories\Contracts\RepositoryInterface as Repository;
 
-class ProductWhere extends Criteria {
+class ProductWhere extends Criteria
+{
 
     private $search = [];
     private $store_id;
     /**
-     * MultiWhere constructor.
+     * ProductWhere constructor.
      * @param array $search
-     *
+     * @param int $store_id
      */
     public function __construct(array $search,int $store_id)
     {
@@ -31,7 +32,7 @@ class ProductWhere extends Criteria {
 
     /**
      * @param $model
-     * @param RepositoryInterface $repository
+     * @param Repository $repository
      * @return mixed
      */
     public function apply($model, Repository $repository)
@@ -40,8 +41,6 @@ class ProductWhere extends Criteria {
             $keyword = '%'.$this->search['keyword'].'%';
             $model = $model->where([['name','like',$keyword],['store_id',$this->store_id]])
                 ->orwhere([['id','like',$keyword],['store_id',$this->store_id]]);
-        } else if(isset($this->search['updated_at']) && $this->search['updated_at']) {
-            $model = $model->where('updated_at',$this->search['updated_at']);
         } else {
             $model = $model->where([['store_id',$this->store_id]]);
         }

+ 15 - 1
app/Repositories/Album/UserRepository.php

xqd
@@ -25,7 +25,21 @@ class UserRepository extends Repository {
             $currentQuery = $currentQuery->where(function ($query) use ($keywords) {
                 $query->where('username'  , 'like', $keywords)
                     ->orwhere('phone', 'like', $keywords)
-                    ->orwhere('wechat_open_id', 'like', $keywords);
+                    ->orwhere('open_id', 'like', $keywords);
+            });
+        }
+
+        if (isset($search['role']) && ! empty($search['role']) && $search['role'] != -1) {
+            $role = $search['role'];
+            $currentQuery = $currentQuery->where(function ($query) use ($role) {
+                $query->where('role', $role);
+            });
+        }
+
+        if (isset($search['is_boss']) && ! empty($search['is_boss']) && $search['is_boss'] != -1) {
+            $is_boss = $search['is_boss'];
+            $currentQuery = $currentQuery->where(function ($query) use ($is_boss) {
+                $query->where('is_boss', $is_boss);
             });
         }
 

+ 33 - 0
database/migrations/2019_05_20_094445_add_column_banners_to_album_poster.php

xqd
@@ -0,0 +1,33 @@
+<?php
+
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class AddColumnBannersToAlbumPoster extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::table('album_poster', function (Blueprint $table) {
+            //
+            $table->longText('banner')->nullable()->comment('九张图');
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::table('album_potser', function (Blueprint $table) {
+            //
+        });
+    }
+}

+ 34 - 0
database/migrations/2019_05_29_163555_add_columns_video_download_to_album_poster.php

xqd
@@ -0,0 +1,34 @@
+<?php
+
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class AddColumnsVideoDownloadToAlbumPoster extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::table('album_poster', function (Blueprint $table) {
+            //
+            $table->string('video_url')->default(null)->nullable()->comment('朋友圈视频');
+            $table->unsignedInteger('downloadNum')->default(0)->comment('下载次数');
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::table('album_poster', function (Blueprint $table) {
+            //
+        });
+    }
+}

+ 33 - 0
database/migrations/2019_05_29_172519_add_columns_title_to_album_poster.php

xqd
@@ -0,0 +1,33 @@
+<?php
+
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class AddColumnsTitleToAlbumPoster extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::table('album_poster', function (Blueprint $table) {
+            //
+            $table->string('name')->nullable()->default(null)->comment('標題');
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::table('album_poster', function (Blueprint $table) {
+            //
+        });
+    }
+}

+ 33 - 0
database/migrations/2019_05_30_132301_drop_column_in_album_poster.php

xqd
@@ -0,0 +1,33 @@
+<?php
+
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class DropColumnInAlbumPoster extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::table('album_poster', function (Blueprint $table) {
+            //
+            $table->dropColumn(['share', 'title']);
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::table('album_poster', function (Blueprint $table) {
+            //
+        });
+    }
+}

+ 34 - 0
database/migrations/2019_05_30_132708_add_column_share_to_album_manufacturer.php

xqd
@@ -0,0 +1,34 @@
+<?php
+
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class AddColumnShareToAlbumManufacturer extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::table('album_manufacturer', function (Blueprint $table) {
+            //
+            $table->string('share_title', 50)->nullable()->default(null)->comment('分享标题');
+            $table->string('share_image', 50)->nullable()->default(null)->comment('分享图片');
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::table('album_manufacturer', function (Blueprint $table) {
+            //
+        });
+    }
+}

+ 33 - 0
database/migrations/2019_05_30_141921_add_type_column_in_album_poster.php

xqd
@@ -0,0 +1,33 @@
+<?php
+
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class AddTypeColumnInAlbumPoster extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::table('album_poster', function (Blueprint $table) {
+            //
+            $table->unsignedInteger('share_type')->default(0)->nullable();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::table('album_poster', function (Blueprint $table) {
+            //
+        });
+    }
+}

+ 33 - 0
database/migrations/2019_05_30_153526_drop_banner_column_in_album_poster.php

xqd
@@ -0,0 +1,33 @@
+<?php
+
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class DropBannerColumnInAlbumPoster extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::table('album_poster', function (Blueprint $table) {
+            //
+            $table->dropColumn(['banner','introduce','qrcode']);
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::table('album_poster', function (Blueprint $table) {
+            //
+        });
+    }
+}

+ 32 - 0
database/migrations/2019_05_30_155851_add_qrcode_to_album_manufacturer.php

xqd
@@ -0,0 +1,32 @@
+<?php
+
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class AddQrcodeToAlbumManufacturer extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::table('album_manufacturer', function (Blueprint $table) {
+            $table->string('qrcode', 255)->nullable()->default(null);
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::table('album_manufacturer', function (Blueprint $table) {
+            //
+        });
+    }
+}

+ 32 - 0
database/migrations/2019_05_30_200039_drop_column_album_banner.php

xqd
@@ -0,0 +1,32 @@
+<?php
+
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class DropColumnAlbumBanner extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::table('album_banner', function (Blueprint $table) {
+            $table->dropColumn(['type','page_url']);
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::table('album_banner', function (Blueprint $table) {
+            //
+        });
+    }
+}

+ 34 - 0
database/migrations/2019_05_31_095826_add_column_to_album_mancufacturer.php

xqd
@@ -0,0 +1,34 @@
+<?php
+
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class AddColumnToAlbumMancufacturer extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::table('album_manufacturer', function (Blueprint $table) {
+            //
+            $table->string('circleOfFriends', 255)->nullable()->default(null)->comment('朋友圈画报');
+            $table->string('introduce', 30)->nullable()->default(null)->comment('个人二维码介绍语');
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::table('album_mancufacturer', function (Blueprint $table) {
+            //
+        });
+    }
+}

BIN
public/base/img/poster.jpg


BIN
public/base/img/share.jpg


+ 1 - 1
resources/views/admin/album/agent/edit.blade.php

xqd
@@ -67,7 +67,7 @@
 
                 <div class="form-group">
                                     
-                 <label class="control-label col-sm-3">代理类型</label>
+                 <label class="control-label col-sm-3">代理昵称</label>
                                     
                    <div class="col-sm-9">
                      <input id="data_name" name="data[name]" class="form-control" value="{{ $data['name'] or ''}}" required="" aria-required="true"  placeholder="">

+ 145 - 85
resources/views/admin/album/agent/index.blade.php

xqd
@@ -1,115 +1,175 @@
-@extends('admin.layout')
+@extends('admin.layout') 
 
 @section('content')
-	<div class="wrapper wrapper-content animated fadeInRight">
-		<div class="row">
-			<div class="col-sm-12">
-				<div class="ibox float-e-margins">
-					<div class="ibox-title">
-						<h5>经销商管理</h5>
-						<div class="ibox-tools">
-							<a class="collapse-link"> <i class="fa fa-chevron-up"></i>
-							</a>
-						</div>
+<div class="wrapper wrapper-content animated fadeInRight">
+	<div class="row">
+		<div class="col-sm-12">
+			<div class="ibox float-e-margins">
+				<div class="ibox-title">
+					<h5>经销商管理</h5>
+					<div class="ibox-tools">
+						<a class="collapse-link"> <i class="fa fa-chevron-up"></i>
+						</a>
 					</div>
-					<div class="ibox-content">
-						<div class="row">
-							<form method="GET" action="" accept-charset="UTF-8">
+				</div>
+				<div class="ibox-content">
+				    <div class="row">
+				        <form method="GET" action="" accept-charset="UTF-8">
 
-								<div class="col-sm-4">
-									<div class="input-group">
-										<input type="text" value="{{Request::get('keyword')}}"	placeholder="可搜索ID/电话/地址/名称" name="keyword"class="input-sm form-control">
-										<span class="input-group-btn">
+				        <div class="col-sm-4">
+				            <div class="input-group">
+								<input type="text" value="{{Request::get('keyword')}}"	placeholder="可搜索ID/电话/地址/名称" name="keyword"class="input-sm form-control">
+								<span class="input-group-btn">
 									<button type="submit" class="btn btn-sm btn-primary">搜索</button>
 								</span>
-									</div>
-								</div>
-							</form>
-							{{--@if(role('Album/Agent/create'))
-                            <div class="col-sm-3 pull-right">
-                               <a href="{{ U('Album/Agent/create')}}" class="btn btn-sm btn-primary pull-right">添加</a>
-                            </div>
-                            @endif--}}
+    						</div>
+				        </div>
+				        </form>
+						<div class="col-sm-4 pull-left">
+							<a href="{{ U('Album/Agent/index', ['status' => -1])}}" class="btn btn-sm btn-primary pull-left" style="margin-left: 1px;">全部</a>
+							<a href="{{ U('Album/Agent/index', ['status' => 1])}}" class="btn btn-sm btn-primary pull-left" style="margin-left: 1px;">未审核</a>
+							<a href="{{ U('Album/Agent/index', ['status' => 2])}}" class="btn btn-sm btn-primary pull-left" style="margin-left: 1px;">已审核</a>
+							<a href="{{ U('Album/Agent/index', ['status' => 3])}}" class="btn btn-sm btn-primary pull-left" style="margin-left: 1px;">BOSS</a>
 						</div>
-
-						<table class="table table-striped table-bordered table-hover dataTables-example dataTable">
-							<thead>
-							<tr>
-
+						@if(role('Album/Agent/batch'))
+    					<div class="col-sm-3 pull-right">
+    					   <a class="btn btn-sm btn-primary pull-right" onclick="batch()">批量审核</a>
+    					</div>
+						@endif
+					</div>
+					
+					<table class="table table-striped table-bordered table-hover dataTables-example dataTable">
+						<thead>
+    						<tr>
+								<th><input class="checkAll" type="checkbox"></th>
 								<th class="sorting" data-sort="id"> ID </th>
 								<th> 微信昵称 </th>
+								<th class="sorting" data-sort="name"> 名称 </th>
 								<th class="sorting" data-sort="user_id"> 电话 </th>
 								<th class="sorting" data-sort="address"> 地址 </th>
-								<th class="sorting" data-sort="name"> 名称 </th>
-								<th class="sorting" data-sort="status"> 状态 </th>
+								<th class="sorting" data-sort="status"> 审核状态 </th>
 								<th>是否为boss</th>
-								<th width="22%">相关操作</th>
-							</tr>
-							</thead>
-							<tbody>
-							@if(isset($list))
-								@foreach($list as $key => $item)							<tr>
-
-									<td>{{ $item->id }}</td>
-									<td>{{ $item->nickname }}</td>
-									<td>{{ $item->phone }}</td>
-									<td>{{ $item->address }}</td>
-									<td>{{ $item->name }}</td>
-									<td>{{ $item->status }}</td>
-									@if($item->is_boss != 1)
-										<td>不是</td>
-									@else
-										<td>是</td>
-									@endif
-									<td>
-										<div class="pull-left">
-											@if(role('Album/User/role-boss'))
-												@if($item->is_boss == 0)
-													<a href="{{ U('Album/User/role',['id'=>$item->user_id,'role'=>4]) }}" class="btn btn-sm btn-default pull-right">设为Boss
-													</a>
-												@else
-													<a href="{{ U('Album/User/role',['id'=>$item->user_id,'role'=>5]) }}" class="btn btn-sm btn-default pull-right">取消Boss
-													</a>
-												@endif
+        						<th width="22%">相关操作</th>
+        					</tr>
+						</thead>
+						<tbody>
+						@if(isset($list))
+							@foreach($list as $key => $item)							<tr>
+								<td><input id="{{ $item->user_id }}" class="checkItem" name="checkItem" type="checkbox"></td>
+								<td>{{ $item->id }}</td>
+								<td>{{ $item->nickname }}</td>
+								<td>{{ $item->name }}</td>
+								<td>{{ $item->phone }}</td>
+								<td>{{ $item->address }}</td>
+								<td>{{ $item->status }}</td>
+								@if($item->is_boss != 1)
+									<td>不是</td>
+								@else
+									<td>是</td>
+								@endif
+								<td>
+									<div class="pull-left">
+										@if(role('Album/User/role-boss'))
+											@if($item->is_boss == 0)
+												<a href="{{ U('Album/User/role',['id'=>$item->user_id,'role'=>4]) }}" class="btn btn-sm btn-default pull-right">设为Boss
+												</a>
+											@else
+												<a href="{{ U('Album/User/role',['id'=>$item->user_id,'role'=>5]) }}" class="btn btn-sm btn-default pull-right">取消Boss
+												</a>
 											@endif
+										@endif
 
-											@if(role('Album/Agent/update'))
+										@if(role('Album/Agent/update'))
 												<a href="{{ U('Album/Agent/update',['id'=>$item->id])}}" class="btn btn-sm btn-warning pull-right">修改</a>
-											@endif
-											@if(role('Album/Agent/status'))
+										@endif
+										@if(role('Album/Agent/status'))
 												@if($item->status == '待审核')
 													<a href="{{ U('Album/Agent/status',['id'=>$item->id,'status'=>1])}}" onclick="return confirm('你确定通过审核?');" class="btn btn-sm btn-success pull-right">通过审核</a>
 												@endif
-											@endif
-											@if(role('Album/Agent/destroy'))
+										@endif
+										@if(role('Album/Agent/destroy'))
 												<a href="{{ U('Album/Agent/destroy',['id'=>$item->id])}}" onclick="return confirm('你确定执行删除操作?');" class="btn btn-sm btn-danger pull-right">删除</a>
+										@endif
+										@if(role('Album/Product/Price/index'))
+											@if($item->status == '已审核')
+												<a href="{{ U('Album/Product/Price/index',['id'=>$item->id])}}" class="btn btn-sm btn-primary pull-left">查看报价</a>
 											@endif
-											@if(role('Album/Product/Price/index'))
-												<a href="{{ U('Album/Product/Price/index',['id'=>$item->id])}}" class="btn btn-sm btn-primary pull-right">查看报价</a>
-											@endif
+										@endif
 
-										</div>
-									</td>
-								</tr>
-								@endforeach
+									</div>
+								</td>
+							</tr>
+							@endforeach
 							@endif
 
-							</tbody>
-						</table>
-						<div class="row">
-							<div class="col-sm-6">
-								<div class="dataTables_info" id="DataTables_Table_0_info"
-									 role="alert" aria-live="polite" aria-relevant="all">每页{{ $list->count() }}条,共{{ $list->lastPage() }}页,总{{ $list->total() }}条。</div>
-							</div>
-							<div class="col-sm-6">
-								<div class="dataTables_paginate paging_simple_numbers" id="DataTables_Table_0_paginate">
-									{!! $list->setPath('')->appends(Request::all())->render() !!}
-								</div>
-							</div>
+						</tbody>
+					</table>
+					<div class="row">
+						<div class="col-sm-6">
+							<div class="dataTables_info" id="DataTables_Table_0_info"
+								role="alert" aria-live="polite" aria-relevant="all">每页{{ $list->count() }}条,共{{ $list->lastPage() }}页,总{{ $list->total() }}条。</div>
+						</div>
+						<div class="col-sm-6">
+						<div class="dataTables_paginate paging_simple_numbers" id="DataTables_Table_0_paginate">
+						{!! $list->setPath('')->appends(Request::all())->render() !!}
+						</div>
 						</div>
 					</div>
 				</div>
 			</div>
 		</div>
 	</div>
+</div>
+<link href="{{ session()->get('is_we7')=='true'?'/addons/furnitureWe7/public':'' }}/base/css/plugins/toastr/toastr.min.css" rel="stylesheet">
+<script src="{{ session()->get('is_we7')=='true'?'/addons/furnitureWe7/public':'' }}/base/js/plugins/toastr/toastr.min.js"></script>
+<script>
+    toastr.options.positionClass = 'toast-bottom-center';
+    var checkArr = [];
+    $(".checkItem").click(function () {
+        checkArr = [];
+        $("input:checkbox[name=checkItem]:checked").each(function () {
+            checkArr.push($(this).attr("id"))
+        })
+    })
+
+	$(".checkAll").click(function () {
+        $(".checkItem").each(function () {
+            if ($(this).prop('checked')) {
+                $(this).prop('checked',false)
+            } else {
+                $(this).prop('checked',true)
+            }
+		})
+        checkArr = [];
+        $("input:checkbox[name=checkItem]:checked").each(function () {
+            checkArr.push($(this).attr("id"))
+        })
+    })
+
+
+	function batch(){
+        if (confirm('确定执行批量操作吗?')) {
+            if (checkArr.length <= 0) {
+                toastr.error('请勾选需要操作的数据!');
+                return false;
+            }
+            $.ajax({
+                url: "{{ U('Album/Agent/batch') }}",
+                method: 'POST',
+                data: {
+                    'data': checkArr,
+                    '_token':"{{ csrf_token() }}"
+                },
+                dataType:'json',
+                success: function(data) {
+					toastr.success('执行成功!')
+                    setTimeout(function () {
+                        location.reload();
+                    }, 3000);
+                }
+            });
+		}
+		return;
+	}
+</script>
 @endsection

+ 2 - 30
resources/views/admin/album/banner/edit.blade.php

xqd xqd
@@ -54,34 +54,6 @@
                                                    placeholder="">
                                         </div>
 
-                                    </div>
-                                    <div class="form-group">
-
-                                        <label class="control-label col-sm-3">链接地址</label>
-
-                                        <div class="col-sm-9">
-                                            <input id="data_page_url" name="data[page_url]" class="form-control"
-                                                   value="{{ $data['page_url'] or ''}}"
-                                                   placeholder="">
-                                        </div>
-
-                                    </div>
-
-                                    <div class="form-group">
-
-                                        <label class="control-label col-sm-3">类型</label>
-
-                                        <div class="col-sm-9">
-                                            <label class="radio-inline">
-                                                <input type="radio" name="data[type]" value="1"
-                                                       @if(isset($data['type']) && $data['type'] == '1')checked="checked" @endif/>商城
-                                            </label>
-                                            <label class="radio-inline">
-                                                <input type="radio" name="data[type]" value="2"
-                                                       @if(isset($data['type']) && $data['type'] == '2')checked="checked" @endif/>拼团
-                                            </label>
-                                        </div>
-
                                     </div>
                                     <div class="form-group">
 
@@ -89,8 +61,8 @@
 
                                         <div class="col-sm-9">
                                             <input id="data_sort" name="data[sort]" class="form-control"
-                                                   value="{{ $data['sort'] or ''}}" required="" aria-required="true"
-                                                   placeholder="值越大越靠前">
+                                                   value="{{ $data['sort'] or '0'}}" required="" aria-required="true"
+                                                   placeholder="值越大越靠前"><span class="help-block m-b-none">数值越大越靠前</span>
                                         </div>
 
                                     </div>

+ 0 - 2
resources/views/admin/album/banner/index.blade.php

xqd xqd
@@ -41,7 +41,6 @@
                                 <th class="sorting" data-sort="id">ID</th>
                                 <th class="sorting" data-sort="pic_url"> 缩略图</th>
                                 <th class="sorting" data-sort="title"> 标题</th>
-                                <th class="sorting" data-sort="page_url">链接地址</th>
                                 <th class="sorting" data-sort="sort"> 排序</th>
                                 <th class="sorting" data-sort="created_at">创建时间</th>
                                 <th width="22%">相关操作</th>
@@ -55,7 +54,6 @@
                                         <td>{{ $item->id }}</td>
                                         <td><img src="{{ $item->pic_url }}" style="height: 50px"></td>
                                         <td>{{ $item->title }}</td>
-                                        <td>{{ $item->page_url }}</td>
                                         <td>{{ $item->sort }}</td>
                                         <td>{{ $item->created_at }}</td>
                                         <td>

+ 80 - 0
resources/views/admin/album/cat/edit-first.blade.php

xqd
@@ -0,0 +1,80 @@
+@extends('admin.layout')
+
+@section('content')
+
+    <?php
+    if(!isset($data)) $data = array();
+    if(!$data && session("data")){
+        $data = session("data");
+    }
+    if(!$data && session('_old_input')){
+        $data = session("_old_input");
+    }
+
+?>
+<div class="wrapper wrapper-content animated fadeInRight">
+	<div class="row">
+		<div class="col-sm-12">
+			<div class="ibox float-e-margins">
+				<div class="ibox-title">
+					<h5>产品分类</h5>
+					<div class="ibox-tools">
+						<a class="collapse-link"> <i class="fa fa-chevron-up"></i>
+						</a>
+					</div>
+				</div>
+				<div class="ibox-content">
+                    @if(role('Album/Cat/index'))
+				    <div class="row">
+    					<div class="col-sm-3 pull-right">
+    					   <a href="{{ U('Album/Cat/index')}}" class="btn btn-sm btn-primary pull-right">返回列表</a>
+    					</div>
+					</div>
+                    @endif
+
+		            <div class="row">
+                        <div class="col-lg-10">
+                            <form name="form_product" id="form-validation" action="" class="form-horizontal form-validation" accept-charset="UTF-8" method="post">
+
+
+                                    
+                <div class="form-group">
+                                    
+                 <label class="control-label col-sm-3">名称</label>
+                                    
+                   <div class="col-sm-9">
+                     <input id="data_name" name="data[name]" class="form-control" value="{{ $data['name'] or ''}}" required="" aria-required="true"  placeholder=""> 
+                    </div>
+                                
+                </div>
+
+                                <div class="form-group">
+                                    <label class="control-label col-sm-3">排序</label>
+                                    <div class="col-sm-5">
+                                        <input id="data_sort" name="data[sort]" class="form-control" value="{{ $data['sort'] or 0}}" required="" aria-required="true"  placeholder="数值越大越靠前">
+                                        <span class="help-block m-b-none">数值越大越靠前</span>
+                                    </div>
+                                </div>
+
+                                    <div class="form-group">
+                                        <label class="control-label col-sm-3">&nbsp;</label>
+                                        <div class="col-sm-9">
+                                            <input type="hidden" name="_referer" value="<?php echo urlencode(request()->server('HTTP_REFERER'));?>"/>
+                                            <input type="hidden" name="_token" value="<?php echo csrf_token(); ?>"/>
+                                            <input type="submit" class="btn btn-success" style="margin-right:20px;">
+                                            <input type="reset" class="btn btn-default" >
+                                        </div>
+                                    </div>
+
+                                </form>
+                            </div>
+                            <!-- /.col-lg-10 -->
+                        </div>
+                        <!-- /.row -->
+                    </div>
+                </div>
+            </div>
+        </div>
+    </div>
+
+@endsection

+ 16 - 7
resources/views/admin/album/cat/edit.blade.php

xqd xqd xqd xqd
@@ -42,7 +42,7 @@
                                     
                  <label class="control-label col-sm-3">名称</label>
                                     
-                   <div class="col-sm-9">
+                   <div class="col-sm-5">
                      <input id="data_name" name="data[name]" class="form-control" value="{{ $data['name'] or ''}}" required="" aria-required="true"  placeholder=""> 
                     </div>
                                 
@@ -51,9 +51,8 @@
                 <div class="form-group">
                     <label class="control-label col-sm-3">父分类</label>
 
-                    <div class="col-sm-9">
-                        <select name="data[parent_id]" id="" class="form-control">
-                            <option value="0">顶级</option>
+                    <div class="col-sm-5">
+                        <select name="data[parent_id]" id="" class="form-control" required="" aria-required="true">
                             @if(isset($cat))
                                 @foreach($cat as $key=>$val)
                                             <option value="{{$val->id}}" @if($val['id'] == $data['parent_id'])selected @endif>{{$val->name}}</option>
@@ -61,9 +60,18 @@
                             @endif
                         </select>
                     </div>
+                    @if(role('Album/Cat/createFirst'))
+                        <div class="col-sm-3 pull-right">
+                            <a href="{{ U('Album/Cat/createFirst',['id' => ($data['id'] ?? 0)])}}" class="btn btn-sm btn-primary pull-right">创建一级分类</a>
+                        </div>
+                    @endif
                 </div>
                 <div class="form-group">
-                    <label class="control-label col-sm-3">图片(300*300)</label>
+                    <label class="control-label col-sm-3">图片
+                        <br/>
+                        <small class="text-navy">(300像素 * 300像素)</small>
+
+                    </label>
                     <div class="col-sm-9">
                         {!!  widget('Tools.ImgUpload')->single2('/upload/cat_pic_url','pic_url',"pic_url",  isset($data['pic_url'])? $data['pic_url'] : '',array("sizex"=>300,"sizey"=>300)) !!}
                     </div>
@@ -71,8 +79,9 @@
 
                                 <div class="form-group">
                                     <label class="control-label col-sm-3">排序</label>
-                                    <div class="col-sm-9">
-                                        <input id="data_sort" name="data[sort]" class="form-control" value="{{ $data['sort'] or ''}}" required="" aria-required="true"  placeholder="数值越大越靠前">
+                                    <div class="col-sm-5">
+                                        <input id="data_sort" name="data[sort]" class="form-control" value="{{ $data['sort'] or 0}}" required="" aria-required="true"  placeholder="数值越大越靠前">
+                                        <span class="help-block m-b-none">数值越大越靠前</span>
                                     </div>
                                 </div>
 

+ 1 - 1
resources/views/admin/album/cat/index.blade.php

xqd
@@ -58,7 +58,7 @@
 									<td>
 										<div class="pull-left">
 											@if(role('Album/Cat/update'))
-												<a href="{{ U('Album/Cat/update',['id'=>$item->id])}}" class="btn btn-sm btn-warning pull-right">修改</a>
+												<a href="{{ U('Album/Cat/updateFirst',['id'=>$item->id])}}" class="btn btn-sm btn-warning pull-right">修改</a>
 											@endif
 											@if(role('Album/Cat/destroy'))
 												<a href="{{ U('Album/Cat/destroy',['id'=>$item->id])}}" onclick="return confirm('你确定执行删除操作?');" class="btn btn-sm btn-danger pull-right">删除</a>

+ 159 - 0
resources/views/admin/album/manufacturer/album-edit.blade.php

xqd
@@ -0,0 +1,159 @@
+@extends('admin.layout')
+@section('header')
+
+    <link href="/base/css/fileinput.css" media="all" rel="stylesheet" type="text/css" />
+
+    <script src="/base/js/fileinput.js" type="text/javascript"></script>
+    <script src="/base/js/fileinput_locale_zh.js" type="text/javascript"></script>
+
+@endsection
+@section('content')
+
+    <?php
+    if (!isset($data)) $data = array();
+    if (!$data && session("data")) {
+        $data = session("data");
+    }
+    if (!$data && session('_old_input')) {
+        $data = session("_old_input");
+    }
+    ?>
+    <div class="wrapper wrapper-content animated fadeInRight">
+        <div class="row">
+            <div class="col-sm-12">
+                <div class="ibox float-e-margins">
+                    <div class="ibox-title">
+                        <h5>系统设置</h5>
+                        <div class="ibox-tools">
+                            <a class="collapse-link"> <i class="fa fa-chevron-up"></i>
+                            </a>
+                        </div>
+                    </div>
+                    <div class="ibox-content">
+                        <div class="row">
+                            <div class="col-lg-10">
+                                <form name="form_product" id="form-validation" action=""
+                                      class="form-horizontal form-validation" accept-charset="UTF-8" method="post">
+
+
+
+
+
+
+
+                                        <div class="form-group">
+
+                                            <label class="control-label col-sm-3">画册appID</label>
+
+                                            <div class="col-sm-9">
+                                                <input id="data_xyx_id" name="data[xyx_id]" class="form-control"
+                                                       value="{{ $data['xyx_id'] or ''}}" required=""
+                                                       aria-required="true" placeholder="">
+                                            </div>
+
+                                        </div>
+                                        <div class="form-group">
+
+                                            <label class="control-label col-sm-3">画册appSecret</label>
+
+                                            <div class="col-sm-9">
+                                                <input id="data_xyx_secret" name="data[xyx_secret]" class="form-control"
+                                                       value="{{ $data['xyx_secret'] or ''}}" required=""
+                                                       aria-required="true" placeholder="">
+                                            </div>
+
+                                        </div>
+                                        <div class="form-group">
+
+                                            <label class="control-label col-sm-3">画册TemplateId</label>
+
+                                            <div class="col-sm-9">
+                                                <input id="data_wxFurniture_template_id" name="data[wxFurniture_template_id]" class="form-control"
+                                                       value="{{ $data['wxFurniture_template_id'] or ''}}" placeholder="">
+                                            </div>
+
+                                        </div>
+                                    <div class="form-group">
+
+                                        <label class="control-label col-sm-3">公众号appID</label>
+
+                                        <div class="col-sm-9">
+                                            <input id="data_service_app_id" name="data[G_app_id]"
+                                                   class="form-control"
+                                                   value="{{ $data['G_app_id'] or ''}}" required=""
+                                                   aria-required="true"
+                                                   placeholder="">
+                                        </div>
+
+                                    </div>
+                                    <div class="form-group">
+
+                                        <label class="control-label col-sm-3">公众号appSecret</label>
+
+                                        <div class="col-sm-9">
+                                            <input id="data_service_app_secret" name="data[G_app_secret]"
+                                                   class="form-control"
+                                                   value="{{ $data['G_app_secret'] or ''}}" required=""
+                                                   aria-required="true" placeholder="">
+                                        </div>
+
+                                    </div>
+                                    <div class="form-group">
+
+                                        <label class="control-label col-sm-3">公众号TemplateID</label>
+
+                                        <div class="col-sm-9">
+                                            <input id="data_wxaccount_template_id" name="data[wxaccount_template_id]"
+                                                   class="form-control"
+                                                   value="{{ $data['wxaccount_template_id'] or ''}}" placeholder="">
+                                        </div>
+
+                                    </div>
+
+
+
+                                    <div class="form-group">
+
+                                        <label class="control-label col-sm-3">是否获取手机号</label>
+
+                                        <div class="col-sm-9">
+                                            <label class="radio-inline">
+                                                <input type="radio" name="data[getPhone]" value="1"
+                                                       @if(isset($data['getPhone']) && $data['getPhone'] == '1')checked="checked" @endif/>是
+                                            </label>
+                                            <label class="radio-inline">
+                                                <input type="radio" name="data[getPhone]" value="0"
+                                                       @if(isset($data['getPhone']) && $data['getPhone'] == '0')checked="checked" @endif/>否
+                                            </label>
+                                        </div>
+
+                                    </div>
+
+                                    <div class="form-group">
+                                        <label class="control-label col-sm-3">&nbsp;</label>
+                                        <div class="col-sm-9">
+                                            <input type="hidden" name="_referer"
+                                                   value="<?php echo urlencode(request()->server('HTTP_REFERER'));?>"/>
+                                            <input type="hidden" name="_token" value="<?php echo csrf_token(); ?>"/>
+                                            <input type="submit" class="btn btn-success" style="margin-right:20px;">
+                                            <input type="reset" class="btn btn-default">
+                                        </div>
+                                    </div>
+
+                                </form>
+                            </div>
+                            <!-- /.col-lg-10 -->
+                        </div>
+                        <!-- /.row -->
+                    </div>
+                </div>
+            </div>
+        </div>
+    </div>
+
+
+    <script type="text/javascript">
+
+
+    </script>
+@endsection

+ 0 - 92
resources/views/admin/album/manufacturer/check.blade.php

xqd
@@ -1,92 +0,0 @@
-@extends('admin.layout')
-
-@section('content')
-	<div class="wrapper wrapper-content animated fadeInRight">
-		<div class="row">
-			<div class="col-sm-12">
-				<div class="ibox float-e-margins">
-					<div class="ibox-title">
-						<h5>系统设置</h5>
-						<div class="ibox-tools">
-							<a class="collapse-link"> <i class="fa fa-chevron-up"></i>
-							</a>
-						</div>
-					</div>
-					<div class="ibox-content">
-						<div class="row">
-							<form method="GET" action="" accept-charset="UTF-8">
-
-								<div class="col-sm-4">
-									<div class="input-group">
-										<input type="text" value="{{Request::get('keyword')}}"	placeholder="请输入关键词" name="keyword"class="input-sm form-control">
-								<span class="input-group-btn">
-									<button type="submit" class="btn btn-sm btn-primary">搜索</button>
-								</span>
-									</div>
-								</div>
-							</form>
-							@if(role('Album/Manufacturer/create'))
-								<div class="col-sm-3 pull-right">
-									<a href="{{ U('Album/Manufacturer/create')}}" class="btn btn-sm btn-primary pull-right">添加</a>
-								</div>
-							@endif
-						</div>
-
-						<table class="table table-striped table-bordered table-hover dataTables-example dataTable dataCheckTable">
-							<thead>
-							<tr>
-								<th><input class="btSelectAll" name="btSelectAll" type="checkbox"></th>
-								
-            <th class="sorting" data-sort="id">  </th>
-            <th class="sorting" data-sort="store_id"> 商户ID </th>
-            <th class="sorting" data-sort="name"> 名称 </th>
-            <th class="sorting" data-sort="illustrated_name"> 电子画报名称 </th>
-            <th class="sorting" data-sort="avatar"> 头像链接 </th>
-            <th class="sorting" data-sort="phone"> 电话 </th>
-            <th class="sorting" data-sort="address"> 地址 </th>
-								<th width="22%">相关操作</th>
-							</tr>
-							</thead>
-							<tbody>
-							@if(isset($list))
-								@foreach($list as $key => $item)
-									<tr>
-									<td><input data-json='{!! json_encode($item) !!}'  name="btSelectItem" class="data_key" type="checkbox" value="{{ $item->id or 0 }}" /></td>
-									
-            <td>{{ $item->id }}</td>
-            <td>{{ $item->store_id }}</td>
-            <td>{{ $item->name }}</td>
-            <td>{{ $item->illustrated_name }}</td>
-            <td>{{ $item->avatar }}</td>
-            <td>{{ $item->phone }}</td>
-            <td>{{ $item->address }}</td>
-									<td>
-										@if(role('Album/Manufacturer/view'))
-											<button onclick="layer.open({type: 2,area: ['80%', '90%'],content: '{{ U('Album/Manufacturer/view',['id'=>$item->id])}}'});"  class="btn btn-primary ">查看</button>
-										@endif
-									</td>
-								</tr>
-								@endforeach
-							@endif
-
-							</tbody>
-						</table>
-						<div class="row">
-							<div class="col-sm-6">
-								<div class="dataTables_info" id="DataTables_Table_0_info"
-									 role="alert" aria-live="polite" aria-relevant="all">每页{{ $list->count() }}条,共{{ $list->lastPage() }}页,总{{ $list->total() }}条。</div>
-							</div>
-							<div class="col-sm-6">
-								<div class="dataTables_paginate paging_simple_numbers" id="DataTables_Table_0_paginate">
-									{!! $list->setPath('')->appends(Request::all())->render() !!}
-								</div>
-							</div>
-						</div>
-					</div>
-				</div>
-			</div>
-		</div>
-	</div>
-	@include('admin.tools.check_script');
-
-@endsection

+ 56 - 1
resources/views/admin/album/manufacturer/edit-all.blade.php

xqd xqd xqd
@@ -235,6 +235,28 @@
                                             {!!  widget('Tools.ImgUpload')->multi2('/upload/agent_banner','agent_banner',"data[agent_banner]",  isset($data['agent_banner'])? $data['agent_banner'] : '') !!}
                                         </div>
                                     </div>
+
+                                    <div class="form-group">
+                                        <label class="control-label col-sm-3">个人二维码画报
+                                            <br/>
+                                            <small class="text-navy">(440像素 * 440像素)</small>
+                                           </label>
+                                        <div class="col-sm-9">
+                                            {!!  widget('Tools.ImgUpload')->single2('/upload/circleOfFriends','circleOfFriends',"circleOfFriends",  isset($data['circleOfFriends'])? $data['circleOfFriends'] : '',array("sizex"=>440,"sizey"=>440)) !!}
+                                        </div>
+                                    </div>
+                                    <div class="form-group">
+
+                                        <label class="control-label col-sm-3">个人二维码介绍语</label>
+
+                                        <div class="col-sm-9">
+                                            <input id="data_introduce" name="data[introduce]" class="form-control"
+                                                   value="{{ $data['introduce'] or ''}}" required="" aria-required="true"
+                                                   placeholder="">
+                                        </div>
+
+                                    </div>
+
                                     <div class="form-group">
 
                                         <label class="control-label col-sm-3">选择版本</label>
@@ -250,6 +272,37 @@
                                             </label>
                                         </div>
 
+                                    </div>
+                                    <div class="form-group">
+
+                                        <label class="control-label col-sm-3">分享画面
+                                            <br/>
+                                            <small class="text-navy">(1080像素 * 1080像素)</small>
+                                           </label>
+                                        <div class="col-sm-9">
+                                            {{--{!!  widget('Tools.ImgUpload')->single2('/upload/cover_pic','cover_pic',"cover_pic",  isset($data['cover_pic'])? $data['cover_pic'] : '',array("sizex"=>662,"sizey"=>510)) !!}--}}
+                                            {!!  widget('Tools.ImgUpload')->single2('/upload/share_image','share_image',"share_image",  isset($data['share_image'])? $data['share_image'] : '',array("sizex"=>1080,"sizey"=>1080)) !!}
+                                            <button type="button" onclick="layer.open({type: 2,area: ['80%', '90%'],content: '{{ U('Album/Manufacturer/viewShare')}}'});"  class="btn btn-primary col-sm-offset-3">查看示例</button>
+                                        </div>
+                                    </div>
+                                    <div class="form-group">
+
+                                        <label class="control-label col-sm-3">分享标题</label>
+
+                                        <div class="col-sm-9">
+                                            <input id="data_introduce" name="data[share_title]" class="form-control" value="{{ $data['share_title'] or ''}}" required="" aria-required="true"  placeholder="">
+                                        </div>
+
+                                    </div>
+                                    <div class="form-group">
+
+                                        <label class="control-label col-sm-3">厂家头像</label>
+
+                                        <div class="col-sm-9">
+                                            {!!  widget('Tools.ImgUpload')->single('avatar',"data[avatar]", isset($data['avatar'])? $data['avatar'] : "") !!}
+
+                                        </div>
+
                                     </div>
                                     <div class="form-group">
 
@@ -412,7 +465,9 @@
 
                                     <div class="form-group">
 
-                                        <label class="control-label col-sm-3">公告图标(50*50)</label>
+                                        <label class="control-label col-sm-3">公告图标
+                                            <br/>
+                                            <small class="text-navy">(50像素 * 50像素)</small></label>
                                         <div class="col-sm-9">
                                             {!!  widget('Tools.ImgUpload')->single2('/upload/notice','notice_icon',"notice_icon",  isset($data['notice_icon'])? $data['notice_icon'] : '',array("sizex"=>50,"sizey"=>50)) !!}
                                         </div>

+ 40 - 11
resources/views/admin/album/manufacturer/edit.blade.php

xqd xqd xqd xqd
@@ -71,7 +71,10 @@
 
                                     <div class="form-group">
 
-                                        <label class="control-label col-sm-3">厂家LOGO(130*130)</label>
+                                        <label class="control-label col-sm-3">厂家LOGO
+                                            <br/>
+                                            <small class="text-navy">(130像素 * 130像素)</small>
+                                        </label>
                                         <div class="col-sm-9">
                                             {!!  widget('Tools.ImgUpload')->single2('/upload/logo','logo',"logo",  isset($data['logo'])? $data['logo'] : '',array("sizex"=>130,"sizey"=>130)) !!}
                                         </div>
@@ -223,11 +226,22 @@
 
                                     <div class="form-group">
 
-                                        <label class="control-label col-sm-3">画册广告图</label>
+                                        <label class="control-label col-sm-3">开屏广告图</label>
                                         <div class="col-sm-9">
                                             {!!  widget('Tools.ImgUpload')->multi2('/upload/banner','banner',"data[banner]", isset($data['banner'])? $data['banner'] : '',[]) !!}
                                         </div>
                                     </div>
+
+                                    <div class="form-group">
+
+                                        <label class="control-label col-sm-3">厂家头像</label>
+
+                                        <div class="col-sm-9">
+                                            {!!  widget('Tools.ImgUpload')->single('avatar',"data[avatar]", isset($data['avatar'])? $data['avatar'] : "") !!}
+
+                                        </div>
+
+                                    </div>
                                     <div class="form-group">
                                         <label class="control-label col-sm-3">经销商画报</label>
                                         <div class="col-sm-9">
@@ -251,6 +265,28 @@
                                         </div>
 
                                     </div>
+                                    <div class="form-group">
+
+                                        <label class="control-label col-sm-3">分享画面
+                                            <br/>
+                                            <small class="text-navy">(1080像素 * 1080像素)</small>
+                                        </label>
+                                        <div class="col-sm-9">
+                                            {{--{!!  widget('Tools.ImgUpload')->single2('/upload/cover_pic','cover_pic',"cover_pic",  isset($data['cover_pic'])? $data['cover_pic'] : '',array("sizex"=>662,"sizey"=>510)) !!}--}}
+                                            {!!  widget('Tools.ImgUpload')->single2('/upload/share_image','share_image',"share_image",  isset($data['share_image'])? $data['share_image'] : '',array("sizex"=>1080,"sizey"=>1080)) !!}
+                                            <button type="button" onclick="layer.open({type: 2,area: ['80%', '90%'],content: '{{ U('Album/Manufacturer/viewShare')}}'});"  class="btn btn-primary col-sm-offset-3">查看示例</button>
+                                        </div>
+                                    </div>
+                                    <div class="form-group">
+
+                                        <label class="control-label col-sm-3">分享标题</label>
+
+                                        <div class="col-sm-9">
+                                            <input id="data_introduce" name="data[share_title]" class="form-control" value="{{ $data['share_title'] or ''}}" required="" aria-required="true"  placeholder="">
+                                        </div>
+
+                                    </div>
+
                                     <div class="form-group">
                                         <label class="control-label col-sm-3">&nbsp;</label>
                                         <div class="col-sm-9">
@@ -301,15 +337,8 @@
                                     <td>{{ $video['name'] }}</td>
                                     <td>{{ $video['url'] }}</td>
                                     <td>
-                                        <div class="btn-group">
-                                            <button data-toggle="dropdown"
-                                                    class="btn btn-warning btn-sm dropdown-toggle"
-                                                    aria-expanded="false">
-                                                操作 <span class="caret"></span>
-                                            </button>
-                                            <ul class="dropdown-menu">
-                                                <li><a href="{{ U('Album/Manufactuier/videoDel',['id'=>$video['id']])}}" onclick="return confirm('你确定执行删除操作?');">删除</a></li>
-                                            </ul>
+                                        <div class="pull-right">
+                                            <a href="{{ U('Album/Manufactuier/videoDel',['id'=>$video['id']])}}" onclick="return confirm('你确定执行删除操作?');" class="btn btn-sm btn-danger pull-right">删除</a>
                                         </div>
 
 

+ 275 - 0
resources/views/admin/album/manufacturer/furniture-platform.blade.php

xqd
@@ -0,0 +1,275 @@
+@extends('admin.layout')
+@section('header')
+
+    <link href="{{ session()->get('is_we7')=='true'?'/addons/furnitureWe7/public':'' }}/base/css/fileinput.css" media="all" rel="stylesheet" type="text/css" />
+
+    <script src="{{ session()->get('is_we7')=='true'?'/addons/furnitureWe7/public':'' }}/base/js/fileinput.js" type="text/javascript"></script>
+    <script src="{{ session()->get('is_we7')=='true'?'/addons/furnitureWe7/public':'' }}/base/js/fileinput_locale_zh.js" type="text/javascript"></script>
+
+@endsection
+@section('content')
+
+    <?php
+    if (!isset($data)) $data = array();
+    if (!$data && session("data")) {
+        $data = session("data");
+    }
+    if (!$data && session('_old_input')) {
+        $data = session("_old_input");
+    }
+    ?>
+    <div class="wrapper wrapper-content animated fadeInRight">
+        <div class="row">
+            <div class="col-sm-12">
+                <div class="ibox float-e-margins">
+                    <div class="ibox-title">
+                        <h5>系统设置</h5>
+                        <div class="ibox-tools">
+                            <a class="collapse-link"> <i class="fa fa-chevron-up"></i>
+                            </a>
+                        </div>
+                    </div>
+                    <div class="ibox-content">
+                        <div class="row">
+                            <div class="col-lg-10">
+                                <form name="form_product" id="form-validation" action=""
+                                      class="form-horizontal form-validation" accept-charset="UTF-8" method="post">
+
+
+
+                                    <div class="form-group">
+
+                                        <label class="control-label col-sm-3">电子画报名称</label>
+
+                                        <div class="col-sm-9">
+                                            <input id="data_illustrated_name" name="data[illustrated_name]"
+                                                   class="form-control" value="{{ $data['illustrated_name'] or ''}}"
+                                                   required="" aria-required="true" placeholder="">
+                                        </div>
+
+                                    </div>
+
+
+                                        <div class="form-group">
+
+                                            <label class="control-label col-sm-3">打印机型号</label>
+
+                                            <div class="col-sm-9">
+                                                <label class="radio-inline">
+                                                    <input type="radio" name="data[print_type]" value="1"
+                                                           @if(isset($data['print_type']) && $data['print_type'] == '1')checked="checked" @endif/>飞鹅
+                                                </label>
+                                                <label class="radio-inline">
+                                                    <input type="radio" name="data[print_type]" value="2"
+                                                           @if(isset($data['print_type']) && $data['print_type'] == '2')checked="checked" @endif/>365
+                                                </label>
+                                            </div>
+
+                                        </div>
+
+
+
+
+
+                                      {{--  <div class="form-group">
+
+                                            <label class="control-label col-sm-3">首页广告图片</label>
+
+                                            <div class="col-sm-9">
+                                                {!!  widget('Tools.ImgUpload')->single('advertising_pic',"data[advertising_pic]", isset($data['advertising_pic'])? $data['advertising_pic'] : "") !!}
+                                            </div>
+
+                                        </div>--}}
+
+                                        <div class="form-group">
+
+                                            <label class="control-label col-sm-3">开屏广告图片</label>
+
+                                            <div class="col-sm-9">
+                                                {!!  widget('Tools.ImgUpload')->single('furniture_ads_pic',"data[furniture_ads_pic]", isset($data['furniture_ads_pic'])? $data['furniture_ads_pic'] : "") !!}
+                                            </div>
+
+                                        </div>
+                                        <div class="form-group">
+
+                                            <label class="control-label col-sm-3">公告
+                                                <br/>
+                                                <small class="help-block m-b-none">(不超过15字)</small>
+                                            </label>
+
+                                            <div class="col-sm-9">
+                                                <input id="data_notice" name="data[notice]" class="form-control"
+                                                       value="{{ $data['notice'] or ''}}" required=""
+                                                       aria-required="true"
+                                                       placeholder="">
+                                            </div>
+
+                                        </div>
+
+                                    <div class="form-group">
+
+                                        <label class="control-label col-sm-3">是否显示公告</label>
+                                        <div class="col-sm-9">
+                                            <label class="radio-inline">
+                                                <input type="radio" name="data[show_notice]" value="1"
+                                                       @if(isset($data['show_notice']) && $data['show_notice'] == '1')checked="checked" @endif/>显示
+                                            </label>
+                                            <label class="radio-inline">
+                                                <input type="radio" name="data[show_notice]" value="0"
+                                                       @if(isset($data['show_notice']) && $data['show_notice'] == '0')checked="checked" @endif/>不显示
+                                            </label>
+                                        </div>
+
+                                    </div>
+
+                                        <div class="form-group">
+
+                                            <label class="control-label col-sm-3">公告图标<br/>
+                                                <small class="help-block m-b-none">(50像素 * 50像素)</small></label>
+                                            <div class="col-sm-9">
+                                                {!!  widget('Tools.ImgUpload')->single2('/upload/notice','notice_icon',"notice_icon",  isset($data['notice_icon'])? $data['notice_icon'] : '',array("sizex"=>50,"sizey"=>50)) !!}
+                                            </div>
+
+                                        </div>
+
+
+
+                                      <hr/>
+
+                                    <div class="form-group">
+
+                                        <label class="control-label col-sm-3">画册广告图</label>
+                                        <div class="col-sm-9">
+                                            {!!  widget('Tools.ImgUpload')->multi2('/upload/banner','banner',"data[banner]", isset($data['banner'])? $data['banner'] : '',[]) !!}
+                                        </div>
+                                    </div>
+
+                                    <div class="form-group">
+                                        <label class="control-label col-sm-3">&nbsp;</label>
+                                        <div class="col-sm-9">
+                                            <input type="hidden" name="_referer"
+                                                   value="<?php echo urlencode(request()->server('HTTP_REFERER'));?>"/>
+                                            <input type="hidden" name="_token" value="<?php echo csrf_token(); ?>"/>
+                                            <input type="submit" class="btn btn-success" style="margin-right:20px;">
+                                            <input type="reset" class="btn btn-default">
+                                        </div>
+                                    </div>
+
+                                </form>
+                            </div>
+                            <!-- /.col-lg-10 -->
+                        </div>
+                        <!-- /.row -->
+                    </div>
+                </div>
+            </div>
+        </div>
+
+
+        <div class="modal fade" id="myModal" tabindex="-1" role="dialog"
+             aria-labelledby="myModalLabel" aria-hidden="true">
+            <div class="modal-dialog" style="min-width:60%;">
+                <div class="modal-content">
+                    <div class="modal-header">
+                        <h4 class="modal-title" id="myModalLabel">
+                            选择坐标
+                        </h4>
+                    </div>
+                    <div class="modal-body">
+                        <div id="container" style="width: 100%;min-height: 400px;"></div>
+                        <div id="myPageTop">
+                            <table>
+                                <tr>
+                                    <td>
+                                        <label>按关键字搜索:</label>
+                                    </td>
+                                    <td>
+
+                                    </td>
+
+                                </tr>
+                                <tr>
+                                    <td>
+                                        <input style="margin-right: 10px;min-width:300px"
+                                               value="{{ isset($data['address'])?$data['address'] : "" }}" type="text"
+                                               placeholder="请输入关键字进行搜索" id="tipinput">
+                                    </td>
+                                    <td>
+                                        <div style="margin-right: 10px;" class="btn btn-sm btn-primary"
+                                             id="confirm">显示搜索点
+                                        </div>
+                                    </td>
+                                    <td class="column2">
+                                        <input type="hidden" readonly="true" id="lnglat">
+                                    </td>
+                                </tr>
+                            </table>
+                            <br>
+                            <button type="button" id="modal-close" class="btn btn-sm btn-primary text-center"
+                                    data-dismiss="modal">确认位置信息
+                            </button>
+                        </div>
+                        <div id="panel"></div>
+                    </div>
+
+                </div><!-- /.modal-content -->
+            </div><!-- /.modal -->
+        </div>
+    </div>
+
+
+    <script type="text/javascript">
+        var map = new AMap.Map("container", {
+            resizeEnable: true,
+            zoom: 10
+        });
+        $("#confirm").click(function () {
+            var val = $('#tipinput').val();
+            AMap.service(["AMap.PlaceSearch"], function () {
+                var placeSearch = new AMap.PlaceSearch({ //构造地点查询类
+                    pageSize: 5,
+                    pageIndex: 1,
+                    map: map,
+                    panel: "panel"
+                });
+                placeSearch.search(val);
+            });
+        });
+
+        //为地图注册click事件获取鼠标点击出的经纬度坐标
+        var clickEventListener = map.on('click', function (e) {
+            document.getElementById("lnglat").value = e.lnglat.getLng() + ',' + e.lnglat.getLat();
+        });
+
+        AMap.plugin('AMap.Geocoder', function () {
+            var geocoder = new AMap.Geocoder({});
+            var marker = new AMap.Marker({
+                map: map,
+                bubble: true
+            })
+            map.on('click', function (e) {
+                console.log(e);
+                marker.setPosition(e.lnglat);
+                $('#lon').val(e.lnglat.getLng());
+                $('#lat').val(e.lnglat.getLat());
+                geocoder.getAddress(e.lnglat, function (status, result) {
+                    if (status == 'complete') {
+                        console.log(result);
+                        document.getElementById('tipinput').value = result.regeocode.formattedAddress
+                    }
+                })
+            })
+
+        });
+        $("#modal-close").click(function () {
+            var b = ($('#tipinput').val());
+            console.log(b);
+            $('#map').val(b);
+            $('#add').val(b);
+        });
+        /*  $('.sg-datepicker').datepicker({
+              format: 'yyyy-mm-dd',
+              language: 'zh-CN'
+          });*/
+    </script>
+@endsection

+ 3 - 98
resources/views/admin/album/manufacturer/edit-furniture.blade.php → resources/views/admin/album/manufacturer/furniture-system.blade.php

xqd xqd xqd
@@ -1,10 +1,10 @@
 @extends('admin.layout')
 @section('header')
 
-    <link href="/base/css/fileinput.css" media="all" rel="stylesheet" type="text/css" />
+    <link href="{{ session()->get('is_we7')=='true'?'/addons/furnitureWe7/public':'' }}/base/css/fileinput.css" media="all" rel="stylesheet" type="text/css" />
 
-    <script src="/base/js/fileinput.js" type="text/javascript"></script>
-    <script src="/base/js/fileinput_locale_zh.js" type="text/javascript"></script>
+    <script src="{{ session()->get('is_we7')=='true'?'/addons/furnitureWe7/public':'' }}/base/js/fileinput.js" type="text/javascript"></script>
+    <script src="{{ session()->get('is_we7')=='true'?'/addons/furnitureWe7/public':'' }}/base/js/fileinput_locale_zh.js" type="text/javascript"></script>
 
 @endsection
 @section('content')
@@ -36,10 +36,6 @@
                                       class="form-horizontal form-validation" accept-charset="UTF-8" method="post">
 
 
-
-
-
-
                                         <div class="form-group">
 
                                             <label class="control-label col-sm-3">产品跳转小程序appID</label>
@@ -151,97 +147,6 @@
 
                                         </div>
 
-                                      {{--  <div class="form-group">
-
-                                            <label class="control-label col-sm-3">首页广告图片</label>
-
-                                            <div class="col-sm-9">
-                                                {!!  widget('Tools.ImgUpload')->single('advertising_pic',"data[advertising_pic]", isset($data['advertising_pic'])? $data['advertising_pic'] : "") !!}
-                                            </div>
-
-                                        </div>--}}
-
-                                        <div class="form-group">
-
-                                            <label class="control-label col-sm-3">家具首页广告图片</label>
-
-                                            <div class="col-sm-9">
-                                                {!!  widget('Tools.ImgUpload')->single('furniture_ads_pic',"data[furniture_ads_pic]", isset($data['furniture_ads_pic'])? $data['furniture_ads_pic'] : "") !!}
-                                            </div>
-
-                                        </div>
-                                        <div class="form-group">
-
-                                            <label class="control-label col-sm-3">公告(不超过100字)</label>
-
-                                            <div class="col-sm-9">
-                                                <input id="data_notice" name="data[notice]" class="form-control"
-                                                       value="{{ $data['notice'] or ''}}" required=""
-                                                       aria-required="true"
-                                                       placeholder="">
-                                            </div>
-
-                                        </div>
-
-                                    <div class="form-group">
-
-                                        <label class="control-label col-sm-3">是否显示公告</label>
-                                        <div class="col-sm-9">
-                                            <label class="radio-inline">
-                                                <input type="radio" name="data[show_notice]" value="1"
-                                                       @if(isset($data['show_notice']) && $data['show_notice'] == '1')checked="checked" @endif/>显示
-                                            </label>
-                                            <label class="radio-inline">
-                                                <input type="radio" name="data[show_notice]" value="0"
-                                                       @if(isset($data['show_notice']) && $data['show_notice'] == '0')checked="checked" @endif/>不显示
-                                            </label>
-                                        </div>
-
-                                    </div>
-
-                                        <div class="form-group">
-
-                                            <label class="control-label col-sm-3">公告图标(50*50)</label>
-                                            <div class="col-sm-9">
-                                                {!!  widget('Tools.ImgUpload')->single2('/upload/notice','notice_icon',"notice_icon",  isset($data['notice_icon'])? $data['notice_icon'] : '',array("sizex"=>50,"sizey"=>50)) !!}
-                                            </div>
-
-                                        </div>
-
-
-
-                                      <hr/>
-                                   {{-- <div class="form-group">
-
-                                        <label class="control-label col-sm-3">画册appID</label>
-
-                                        <div class="col-sm-9">
-                                            <input id="data_app_id" name="data[app_id]" class="form-control"
-                                                   value="{{ $data['app_id'] or ''}}" required=""
-                                                   aria-required="true" placeholder="">
-                                        </div>
-
-                                    </div>
-                                    <div class="form-group">
-
-                                        <label class="control-label col-sm-3">画册appSecret</label>
-
-                                        <div class="col-sm-9">
-                                            <input id="data_app_secret" name="data[app_secret]" class="form-control"
-                                                   value="{{ $data['app_secret'] or ''}}" required=""
-                                                   aria-required="true" placeholder="">
-                                        </div>
-
-                                    </div>--}}
-
-                                    <div class="form-group">
-
-                                        <label class="control-label col-sm-3">画册广告图</label>
-                                        <div class="col-sm-9">
-                                            {!!  widget('Tools.ImgUpload')->multi2('/upload/banner','banner',"data[banner]", isset($data['banner'])? $data['banner'] : '',[]) !!}
-                                        </div>
-                                    </div>
-
                                     <div class="form-group">
                                         <label class="control-label col-sm-3">&nbsp;</label>
                                         <div class="col-sm-9">

+ 8 - 11
resources/views/admin/album/manufacturer/index.blade.php

xqd xqd
@@ -6,7 +6,7 @@
             <div class="col-sm-12">
                 <div class="ibox float-e-margins">
                     <div class="ibox-title">
-                        <h5>系统设置</h5>
+                        <h5>厂家管理</h5>
                         <div class="ibox-tools">
                             <a class="collapse-link"> <i class="fa fa-chevron-up"></i>
                             </a>
@@ -67,17 +67,14 @@
                                                 @if(role('Album/Manufacturer/destroy'))
                                                     <a href="{{ U('Album/Manufacturer/destroy',['id'=>$item->id])}}" onclick="return confirm('你确定执行删除操作?');" class="btn btn-sm btn-danger pull-right">删除</a>
                                                 @endif
+                                                <a onclick="window.open('{{ U('/Base/Index/welcome',['store_id'=>$item->store_id])}}','_blank')" class="btn btn-sm btn-warning pull-right">进入</a>
+                                                @if(role('Album/Manufacturer/view'))
+                                                    <button onclick="layer.open({type: 2,area: ['80%', '90%'],content: '{{ U('Album/Manufacturer/view',['id'=>$item->id])}}'});"
+                                                            class="btn btn-primary btn-sm">查看
+                                                    </button>
+                                                @endif
                                             </div>
-                                            <button onclick="window.open('{{ U('/Base/Index/welcome',['store_id'=>$item->store_id])}}','_blank')"
-                                                    class="btn btn-warning btn-sm "
-                                                    aria-expanded="false">
-                                                进入
-                                            </button>
-                                            @if(role('Album/Manufacturer/view'))
-                                                <button onclick="layer.open({type: 2,area: ['80%', '90%'],content: '{{ U('Album/Manufacturer/view',['id'=>$item->id])}}'});"
-                                                        class="btn btn-primary ">查看
-                                                </button>
-                                            @endif
+
                                         </td>
                                     </tr>
                                 @endforeach

+ 359 - 0
resources/views/admin/album/manufacturer/platform-edit.blade.php

xqd
@@ -0,0 +1,359 @@
+@extends('admin.layout')
+@section('header')
+
+    <link href="/base/css/fileinput.css" media="all" rel="stylesheet" type="text/css" />
+
+    <script src="/base/js/fileinput.js" type="text/javascript"></script>
+    <script src="/base/js/fileinput_locale_zh.js" type="text/javascript"></script>
+
+@endsection
+@section('content')
+
+    <?php
+    if (!isset($data)) $data = array();
+    if (!$data && session("data")) {
+        $data = session("data");
+    }
+    if (!$data && session('_old_input')) {
+        $data = session("_old_input");
+    }
+    ?>
+    <div class="wrapper wrapper-content animated fadeInRight">
+        <div class="row">
+            <div class="col-sm-12">
+                <div class="ibox float-e-margins">
+                    <div class="ibox-title">
+                        <h5>平台设置</h5>
+                        <div class="ibox-tools">
+                            <a class="collapse-link"> <i class="fa fa-chevron-up"></i>
+                            </a>
+                        </div>
+                    </div>
+                    <div class="ibox-content">
+                        <div class="row">
+                            <div class="col-lg-10">
+                                <form name="form_product" id="form-validation" action=""
+                                      class="form-horizontal form-validation" accept-charset="UTF-8" method="post">
+
+
+
+                                        <div class="form-group">
+
+                                            <label class="control-label col-sm-3">厂家名称</label>
+
+                                            <div class="col-sm-9">
+                                                <input id="data_name" name="data[name]" class="form-control"
+                                                       value="{{ $data['name'] or ''}}" required="" aria-required="true"
+                                                       placeholder="">
+                                            </div>
+
+                                        </div>
+                                        <div class="form-group">
+
+                                            <label class="control-label col-sm-3">厂家头像</label>
+
+                                            <div class="col-sm-9">
+                                                {!!  widget('Tools.ImgUpload')->single('avatar',"data[avatar]", isset($data['avatar'])? $data['avatar'] : "") !!}
+
+                                            </div>
+
+                                        </div>
+
+                                    <div class="form-group">
+                                        <label class="control-label col-sm-3">个人二维码画报
+                                            <br/>
+                                            <small class="text-navy">(440像素 * 440像素)</small>
+                                            </label>
+                                        <div class="col-sm-9">
+                                            {!!  widget('Tools.ImgUpload')->single2('/upload/circleOfFriends','circleOfFriends',"circleOfFriends",  isset($data['circleOfFriends'])? $data['circleOfFriends'] : '',array("sizex"=>440,"sizey"=>440)) !!}
+                                        </div>
+                                    </div>
+                                    <div class="form-group">
+
+                                        <label class="control-label col-sm-3">个人二维码介绍语</label>
+
+                                        <div class="col-sm-9">
+                                            <input id="data_introduce" name="data[introduce]" class="form-control"
+                                                   value="{{ $data['introduce'] or ''}}" required="" aria-required="true"
+                                                   placeholder="">
+                                        </div>
+
+                                    </div>
+
+                                    <div class="form-group">
+
+                                        <label class="control-label col-sm-3">厂家二维码
+                                            <br/>
+                                            <small class="text-navy">(430像素 * 430像素)</small>
+                                            </label>
+                                        <div class="col-sm-9">
+                                            {!!  widget('Tools.ImgUpload')->single2('/upload/qrcode','qrcode',"qrcode",  isset($data['qrcode'])? $data['qrcode'] : '',array("sizex"=>430,"sizey"=>430)) !!}
+                                        </div>
+
+                                    </div>
+
+
+
+                                        <div class="form-group">
+
+                                            <label class="control-label col-sm-3">电话</label>
+
+                                            <div class="col-sm-9">
+                                                <input id="data_phone" name="data[phone]" class="form-control"
+                                                       value="{{ $data['phone'] or ''}}" required=""
+                                                       aria-required="true"
+                                                       placeholder="">
+                                            </div>
+
+                                        </div>
+
+                                        <!--引入高德地图API-->
+                                        <script type="text/javascript"
+                                                src="https://webapi.amap.com/maps?v=1.3&key=533117702a063eae1dc26c183a1ac7bb&plugin=AMap.Autocomplete"></script>
+                                        <script type="text/javascript"
+                                                src="https://cache.amap.com/lbs/static/addToolbar.js"></script>
+                                        <div class="form-group">
+                                            <label class="control-label col-sm-3">地址<span
+                                                        style="color: red">*</span></label>
+                                            <div class="col-sm-9">
+                                                <input n name="data[address]" readonly="true"
+                                                       value="{{$data['address'] or ''}}" class="form-control" id="add"
+                                                       data-toggle="modal"
+                                                       data-target="#myModal">
+                                            </div>
+                                        </div>
+
+                                        <input type="hidden" name="lon" id="lon" value="{{$data['lon'] or ''}}">
+                                        <input type="hidden" name="lat" id="lat" value="{{$data['lat'] or ''}}">
+
+
+                                    <div class="form-group">
+                                        <label class="control-label col-sm-3">经销商画报</label>
+                                        <div class="col-sm-9">
+                                            {{--     //{!! ueditor('') !!}--}}
+                                            {!!  widget('Tools.ImgUpload')->multi2('/upload/agent_banner','agent_banner',"data[agent_banner]",  isset($data['agent_banner'])? $data['agent_banner'] : '') !!}
+                                        </div>
+                                    </div>
+
+                                    <div class="form-group">
+
+                                        <label class="control-label col-sm-3">厂家LOGO
+                                            <br/>
+                                            <small class="text-navy">(130像素 * 130像素)</small>
+                                            </label>
+                                        <div class="col-sm-9">
+                                            {!!  widget('Tools.ImgUpload')->single2('/upload/logo','logo',"logo",  isset($data['logo'])? $data['logo'] : '',array("sizex"=>130,"sizey"=>130)) !!}
+                                        </div>
+
+                                    </div>
+
+                                    <div class="form-group">
+
+                                        <label class="control-label col-sm-3">开屏广告图</label>
+                                        <div class="col-sm-9">
+                                            {!!  widget('Tools.ImgUpload')->multi2('/upload/banner','banner',"data[banner]", isset($data['banner'])? $data['banner'] : '',[]) !!}
+                                        </div>
+                                    </div>
+
+
+
+                                    <div class="form-group">
+
+                                        <label class="control-label col-sm-3">分享画面
+                                            <br/>
+                                            <small class="text-navy">(1080像素 * 1080像素)</small>
+                                        </label>
+                                        <div class="col-sm-9">
+                                            {{--{!!  widget('Tools.ImgUpload')->single2('/upload/cover_pic','cover_pic',"cover_pic",  isset($data['cover_pic'])? $data['cover_pic'] : '',array("sizex"=>662,"sizey"=>510)) !!}--}}
+                                            {!!  widget('Tools.ImgUpload')->single2('/upload/share_image','share_image',"share_image",  isset($data['share_image'])? $data['share_image'] : '',array("sizex"=>1080,"sizey"=>1080)) !!}
+                                            <button type="button" onclick="layer.open({type: 2,area: ['80%', '90%'],content: '{{ U('Album/Manufacturer/viewShare')}}'});"  class="btn btn-primary col-sm-offset-3">查看示例</button>
+                                        </div>
+                                    </div>
+                                    <div class="form-group">
+
+                                        <label class="control-label col-sm-3">分享标题</label>
+
+                                        <div class="col-sm-9">
+                                            <input id="data_introduce" name="data[share_title]" class="form-control" value="{{ $data['share_title'] or ''}}" required="" aria-required="true"  placeholder="">
+                                        </div>
+
+                                    </div>
+
+
+
+                                    <div class="form-group">
+                                        <label class="control-label col-sm-3">&nbsp;</label>
+                                        <div class="col-sm-9">
+                                            <input type="hidden" name="_referer"
+                                                   value="<?php echo urlencode(request()->server('HTTP_REFERER'));?>"/>
+                                            <input type="hidden" name="_token" value="<?php echo csrf_token(); ?>"/>
+                                            <input type="submit" class="btn btn-success" style="margin-right:20px;">
+                                            <input type="reset" class="btn btn-default">
+                                        </div>
+                                    </div>
+
+                                </form>
+                            </div>
+                            <!-- /.col-lg-10 -->
+                        </div>
+                        <!-- /.row -->
+                    </div>
+                </div>
+            </div>
+        </div>
+
+        <div class="row">
+            <div class="col-sm-12">
+                <div class="ibox float-e-margins">
+                    <div class="ibox-title">
+                        <h5>视频列表</h5>
+                    </div>
+                    <div class="ibox-content">
+                        <form enctype="multipart/form-data" method="post" action="{{ url('/admin/Album/Manufacturer/uploadVideo') }}">
+                            <div class="form-group">
+                                <input id="file-0b" class="file" type="file" name="video">
+                            </div>
+                            {{csrf_field()}}
+                        </form>
+                        <table class="table">
+                            <thead>
+                            <tr>
+                                <th>#</th>
+                                <th>链接</th>
+                                <th>文件名</th>
+                                <th>操作</th>
+                            </tr>
+                            </thead>
+                            <tbody>
+                            @if(!empty($video))
+                                <tr>
+                                    <td>{{ $video['id'] }}</td>
+                                    <td>{{ $video['name'] }}</td>
+                                    <td>{{ $video['url'] }}</td>
+                                    <td>
+                                        <div class="pull-right">
+                                            <a href="{{ U('Album/Manufactuier/videoDel',['id'=>$video['id']])}}" onclick="return confirm('你确定执行删除操作?');" class="btn btn-sm btn-danger pull-right">删除</a>
+                                        </div>
+                                    </td>
+                                </tr>
+                            @else
+                                <tr>
+                                    <td colspan="4">暂无文件</td>
+                                </tr>
+                            @endif
+
+                            </tbody>
+                        </table>
+
+                    </div>
+                </div>
+            </div>
+        </div>
+
+        <div class="modal fade" id="myModal" tabindex="-1" role="dialog"
+             aria-labelledby="myModalLabel" aria-hidden="true">
+            <div class="modal-dialog" style="min-width:60%;">
+                <div class="modal-content">
+                    <div class="modal-header">
+                        <h4 class="modal-title" id="myModalLabel">
+                            选择坐标
+                        </h4>
+                    </div>
+                    <div class="modal-body">
+                        <div id="container" style="width: 100%;min-height: 400px;"></div>
+                        <div id="myPageTop">
+                            <table>
+                                <tr>
+                                    <td>
+                                        <label>按关键字搜索:</label>
+                                    </td>
+                                    <td>
+
+                                    </td>
+
+                                </tr>
+                                <tr>
+                                    <td>
+                                        <input style="margin-right: 10px;min-width:300px"
+                                               value="{{ isset($data['address'])?$data['address'] : "" }}" type="text"
+                                               placeholder="请输入关键字进行搜索" id="tipinput">
+                                    </td>
+                                    <td>
+                                        <div style="margin-right: 10px;" class="btn btn-sm btn-primary"
+                                             id="confirm">显示搜索点
+                                        </div>
+                                    </td>
+                                    <td class="column2">
+                                        <input type="hidden" readonly="true" id="lnglat">
+                                    </td>
+                                </tr>
+                            </table>
+                            <br>
+                            <button type="button" id="modal-close" class="btn btn-sm btn-primary text-center"
+                                    data-dismiss="modal">确认位置信息
+                            </button>
+                        </div>
+                        <div id="panel"></div>
+                    </div>
+
+                </div><!-- /.modal-content -->
+            </div><!-- /.modal -->
+        </div>
+    </div>
+
+
+    <script type="text/javascript">
+        var map = new AMap.Map("container", {
+            resizeEnable: true,
+            zoom: 10
+        });
+        $("#confirm").click(function () {
+            var val = $('#tipinput').val();
+            AMap.service(["AMap.PlaceSearch"], function () {
+                var placeSearch = new AMap.PlaceSearch({ //构造地点查询类
+                    pageSize: 5,
+                    pageIndex: 1,
+                    map: map,
+                    panel: "panel"
+                });
+                placeSearch.search(val);
+            });
+        });
+
+        //为地图注册click事件获取鼠标点击出的经纬度坐标
+        var clickEventListener = map.on('click', function (e) {
+            document.getElementById("lnglat").value = e.lnglat.getLng() + ',' + e.lnglat.getLat();
+        });
+
+        AMap.plugin('AMap.Geocoder', function () {
+            var geocoder = new AMap.Geocoder({});
+            var marker = new AMap.Marker({
+                map: map,
+                bubble: true
+            })
+            map.on('click', function (e) {
+                console.log(e);
+                marker.setPosition(e.lnglat);
+                $('#lon').val(e.lnglat.getLng());
+                $('#lat').val(e.lnglat.getLat());
+                geocoder.getAddress(e.lnglat, function (status, result) {
+                    if (status == 'complete') {
+                        console.log(result);
+                        document.getElementById('tipinput').value = result.regeocode.formattedAddress
+                    }
+                })
+            })
+
+        });
+        $("#modal-close").click(function () {
+            var b = ($('#tipinput').val());
+            console.log(b);
+            $('#map').val(b);
+            $('#add').val(b);
+        });
+        /*  $('.sg-datepicker').datepicker({
+              format: 'yyyy-mm-dd',
+              language: 'zh-CN'
+          });*/
+    </script>
+@endsection

+ 38 - 31
resources/views/admin/album/nav/edit.blade.php

xqd xqd xqd xqd xqd xqd xqd xqd
@@ -37,20 +37,20 @@
                                 <form name="form_product" id="form-validation" action=""
                                       class="form-horizontal form-validation" accept-charset="UTF-8" method="post">
                                     <div class="form-group">
-                                        <label class="control-label col-sm-3">跳转类型</label>
-                                        <div class="col-sm-9">
-                                            <select name="data[open_type]" id="data_open_type" class="form-control"
-                                                    required="" aria-required="true">
-                                                @foreach(dict()->get('album','nav') as $key=>$val)
-                                                    <option value="{{$key}}"
-                                                            @if($key == (isset($data['open_type'])? $data['open_type']: '' ))selected @endif>{{$val}}</option>
-                                                @endforeach
-                                            </select>
+
+                                        <label class="control-label col-sm-3">图标名称</label>
+
+                                        <div class="col-sm-5">
+                                            <input id="data_name" name="data[name]" class="form-control"
+                                                   value="{{ $data['name'] or ''}}" required="" aria-required="true"
+                                                   placeholder="">
                                         </div>
+
                                     </div>
+
                                     <div class="form-group">
                                         <label class="control-label col-sm-3">位置</label>
-                                        <div class="col-sm-9">
+                                        <div class="col-sm-5">
                                             <select name="data[state]" id="data_state" class="form-control" required=""
                                                     aria-required="true">
                                                 @foreach(dict()->get('album','top_buttom') as $key=>$val)
@@ -63,39 +63,45 @@
 
                                     <div class="form-group">
 
-                                        <label class="control-label col-sm-3">图标名称</label>
+                                        <label class="control-label col-sm-3">默认图标</label>
 
-                                        <div class="col-sm-9">
-                                            <input id="data_name" name="data[name]" class="form-control"
-                                                   value="{{ $data['name'] or ''}}" required="" aria-required="true"
-                                                   placeholder="">
+                                        <div class="col-sm-5">
+                                            {!!  widget('Tools.ImgUpload')->single('pic_url',"data[pic_url]", isset($data['pic_url'])? $data['pic_url'] : "") !!}
                                         </div>
 
                                     </div>
                                     <div class="form-group">
 
-                                        <label class="control-label col-sm-3">导航栏图标</label>
+                                        <label class="control-label col-sm-3">选中图标</label>
 
-                                        <div class="col-sm-9">
-                                            {!!  widget('Tools.ImgUpload')->single('pic_url',"data[pic_url]", isset($data['pic_url'])? $data['pic_url'] : "") !!}
+                                        <div class="col-sm-5">
+                                            {!!  widget('Tools.ImgUpload')->single('pic_url_active',"data[pic_url_active]", isset($data['pic_url_active'])? $data['pic_url_active'] : "") !!}
                                         </div>
 
                                     </div>
+
                                     <div class="form-group">
+                                        <label class="control-label col-sm-3">跳转类型</label>
+                                        <div class="col-sm-5">
+                                            <select name="data[open_type]" id="data_open_type" class="form-control"
+                                                    required="" aria-required="true">
+                                                @foreach(dict()->get('album','nav') as $key=>$val)
+                                                    <option value="{{$key}}"
+                                                            @if($key == (isset($data['open_type'])? $data['open_type']: '' ))selected @endif>{{$val}}</option>
+                                                @endforeach
+                                            </select>
+                                        </div>
+                                    </div>
+
 
-                                        <label class="control-label col-sm-3">导航栏选中图标</label>
 
-                                        <div class="col-sm-9">
-                                            {!!  widget('Tools.ImgUpload')->single('pic_url_active',"data[pic_url_active]", isset($data['pic_url_active'])? $data['pic_url_active'] : "") !!}
-                                        </div>
 
-                                    </div>
 
                                     <div class="form-group re_xcx" style="display: none">
 
                                         <label class="control-label col-sm-3">App_ID</label>
 
-                                        <div class="col-sm-9">
+                                        <div class="col-sm-5">
                                             <input id="data_app_id" name="data[app_id]" class="form-control re_xcx"
                                                    value="{{ $data['app_id'] or ''}}" placeholder="">
                                         </div>
@@ -105,7 +111,7 @@
 
                                         <label class="control-label col-sm-3">页面</label>
 
-                                        <div class="col-sm-9">
+                                        <div class="col-sm-5">
                                             <select name="data[url]" id="data_select_url" class="form-control nav">
 
                                                 @foreach($page as $k=>$v)
@@ -121,7 +127,7 @@
 
                                         <label class="control-label col-sm-3">路径配置</label>
 
-                                        <div class="col-sm-9">
+                                        <div class="col-sm-5">
                                             <input id="data_url" name="data[url]" class="form-control re_xcx"
                                                    value="{{ $data['url'] or ''}}" placeholder="">
                                         </div>
@@ -132,7 +138,7 @@
 
                                         <label class="control-label col-sm-3">拨号电话</label>
 
-                                        <div class="col-sm-9">
+                                        <div class="col-sm-5">
                                             <input id="data_mobile" name="data[mobile]" class="form-control call"
                                                    value="{{ $data['mobile'] or ''}}" placeholder="">
                                         </div>
@@ -148,7 +154,7 @@
 
                                         <label class="control-label col-sm-3">导航地址</label>
 
-                                        <div class="col-sm-9">
+                                        <div class="col-sm-5">
                                             <input n name="data[address]" readonly="true"
                                                    value="{{ (isset($data['address'])?$data['address'] : "")}}"
                                                    class="form-control address" id="add" data-toggle="modal"
@@ -168,7 +174,7 @@
 
                                         <label class="control-label col-sm-3 nav_zhi_name">路径参数</label>
 
-                                        <div class="col-sm-9">
+                                        <div class="col-sm-5">
                                             <input id="data_zhi" name="zhi" class="form-control nav_zhi"
                                                    value="{{$data['zhi'] or ''}}" placeholder="">
                                         </div>
@@ -179,10 +185,11 @@
 
                                         <label class="control-label col-sm-3">排序</label>
 
-                                        <div class="col-sm-9">
+                                        <div class="col-sm-5">
                                             <input id="data_sort" name="data[sort]" class="form-control"
-                                                   value="{{ $data['sort'] or '100'}}" required="" aria-required="true"
+                                                   value="{{ $data['sort'] or '0'}}" required="" aria-required="true"
                                                    placeholder="数值越大越靠前">
+                                            <span class="help-block m-b-none">数值越大越靠前</span>
                                         </div>
 
                                     </div>

+ 2 - 1
resources/views/admin/album/news/edit.blade.php

xqd
@@ -78,8 +78,9 @@
 
                                         <div class="col-sm-9">
                                             <input id="data_sort" name="data[sort]" class="form-control"
-                                                   value="{{ $data['sort'] or ''}}" required="" aria-required="true"
+                                                   value="{{ $data['sort'] or 0}}" required="" aria-required="true"
                                                    placeholder="数值越大越靠前">
+                                            <span class="help-block m-b-none">数值越大越靠前</span>
                                         </div>
 
                                     </div>

+ 7 - 6
resources/views/admin/album/news/index.blade.php

xqd xqd
@@ -40,7 +40,7 @@
 
                                 <th class="sorting" data-sort="id">ID</th>
                                 <th class="sorting" data-sort="title"> 标题</th>
-                                <th class="sorting" data-sort="sort"> 排序:越大越靠前</th>
+                                <th class="sorting" data-sort="sort"> 排序</th>
                                 <th class="sorting" data-sort="created_at">创建时间</th>
                                 <th class="sorting" data-sort="updated_at">更新时间</th>
                                 <th width="22%">相关操作</th>
@@ -64,12 +64,13 @@
                                                 @if(role('Album/News/destroy'))
                                                     <a href="{{ U('Album/News/destroy',['id'=>$item->id])}}" onclick="return confirm('你确定执行删除操作?');" class="btn btn-sm btn-danger pull-right">删除</a>
                                                 @endif
+                                                    @if(role('Album/News/view'))
+                                                        <a onclick="layer.open({type: 2,area: ['80%', '90%'],content: '{{ U('Album/News/view',['id'=>$item->id])}}'});"
+                                                           class="btn btn-sm btn-primary pull-right">查看
+                                                        </a>
+                                                    @endif
                                             </div>
-                                            @if(role('Album/News/view'))
-                                                <button onclick="layer.open({type: 2,area: ['80%', '90%'],content: '{{ U('Album/News/view',['id'=>$item->id])}}'});"
-                                                        class="btn btn-primary ">查看
-                                                </button>
-                                            @endif
+
                                         </td>
                                     </tr>
                                 @endforeach

+ 5 - 5
resources/views/admin/album/order/index.blade.php

xqd xqd xqd xqd
@@ -16,7 +16,7 @@
                     </div>
                     <div class="ibox-content">
                         <div class="row">
-                            <form method="GET" action="" accept-charset="UTF-8">
+                           {{-- <form method="GET" action="" accept-charset="UTF-8">
                                 <div class="col-sm-6" style="margin: auto;float: none">
                                     <div class="input-group">
                                         <input type="text" value="{{Request::get('keyword')}}" placeholder="搜索全部订单"
@@ -26,7 +26,7 @@
 								</span>
                                     </div>
                                 </div>
-                            </form>
+                            </form>--}}
                             @if(role('Album/Order/create'))
                                 <div class="col-sm-3 pull-right">
                                     <a href="{{ U('Album/Order/create')}}"
@@ -37,9 +37,9 @@
                         <div class="row">
                             <form method="GET" action="" accept-charset="UTF-8">
 
-                                <div class="col-sm-6">
+                                <div class="col-sm-8">
                                     <div class="input-group">
-                                        <div class="col-sm-4" style="padding-left: 0">
+                                        <div class="col-sm-5" style="padding-left: 0">
                                             <input type="text" value="{{Request::get('keyword')}}"
                                                    placeholder="订单号/分类/型号/姓名/电话/地址"
                                                    name="keyword" class="input-sm form-control">
@@ -85,7 +85,7 @@
                                     <tr>
                                         <td>{{ $item->sno }}</td>
                                         <td>
-                                            @if(role('Album/Order/getpic')))<span style="cursor: pointer"
+                                            @if(role('Album/Order/getpic'))<span style="cursor: pointer"
                                                   onclick="layer.open({type: 2,area: ['80%', '90%'],title:'图片',content: '{{ U('Album/Order/picture',['id'=>$item->id])}}'});"
                                                   class="label label-default">查看图片</span>
                                             @else

+ 39 - 36
resources/views/admin/album/poster/edit.blade.php

xqd xqd
@@ -1,5 +1,12 @@
 @extends('admin.layout')
+@section('header')
 
+    <link href="/base/css/fileinput.css" media="all" rel="stylesheet" type="text/css" />
+
+    <script src="/base/js/fileinput.js" type="text/javascript"></script>
+    <script src="/base/js/fileinput_locale_zh.js" type="text/javascript"></script>
+
+@endsection
 @section('content')
 
 <?php
@@ -27,77 +34,73 @@
 
 		            <div class="row">
                         <div class="col-lg-10">
-                            <form name="form_product" id="form-validation" action="" class="form-horizontal form-validation" accept-charset="UTF-8" method="post">
+                            <form name="form_product" id="form-validation" enctype="multipart/form-data" action="" class="form-horizontal form-validation" accept-charset="UTF-8" method="post">
                                 <input type="hidden" name="id" value="{{ $data['id'] or ''}}"/>
                                 <div class="form-group">
 
-                                    <label class="control-label col-sm-3">海报(440*440)</label>
-                                    <div class="col-sm-9">
-                                        {!!  widget('Tools.ImgUpload')->multi2('/upload/posters','posters',"data[posters]", isset($data['posters'])? $data['posters'] : '',array("sizex"=>440,"sizey"=>440)) !!}
-                                        <button type="button" onclick="layer.open({type: 2,area: ['80%', '65%'],content: '{{ U('Album/Poster/viewPoster')}}'});"  class="btn btn-primary col-sm-offset-3">查看示例</button>
-                                    </div>
+                                    <label class="control-label col-sm-3">标题</label>
 
-                                </div>
-                                <div class="form-group">
-
-                                 <label class="control-label col-sm-3">话术1</label>
-
-                                   <div class="col-sm-9">
-                                     <input id="data_words" name="data[words][0]" class="form-control" value="{{ $data['words'][0] or ''}}" required="" aria-required="true"  placeholder="">
+                                    <div class="col-sm-9">
+                                        <input id="data_words" name="data[name]" class="form-control" value="{{ $data['name'] ?? ''}}"  required="" aria-required="true"  placeholder="">
                                     </div>
 
                                 </div>
                                 <div class="form-group">
 
-                                    <label class="control-label col-sm-3">话术2</label>
+                                    <label class="control-label col-sm-3">分享类型</label>
 
                                     <div class="col-sm-9">
-                                        <input id="data_words" name="data[words][1]" class="form-control" value="{{ $data['words'][1] or ''}}" required="" aria-required="true"  placeholder="">
+                                        <label class="radio-inline">
+                                            <input type="radio" name="data[share_type]" value="1"
+                                                   @if(isset($data['share_type']) && $data['share_type'] == '1')checked="checked" @endif/>视频
+                                        </label>
+                                        <label class="radio-inline">
+                                            <input type="radio" name="data[share_type]" value="0"
+                                                   @if(isset($data['share_type']) && $data['share_type'] == '0')checked="checked" @endif/>九张图
+                                        </label>
                                     </div>
 
                                 </div>
                                 <div class="form-group">
 
-                                    <label class="control-label col-sm-3">话术3</label>
-
+                                    <label class="control-label col-sm-3">海报 <br/>
+                                        <small class="text-navy">(440像素 * 440像素)</small></label>
                                     <div class="col-sm-9">
-                                        <input id="data_words" name="data[words][2]" class="form-control" value="{{ $data['words'][2] or ''}}" required="" aria-required="true"  placeholder="">
+                                        {!!  widget('Tools.ImgUpload')->multi2('/upload/posters','posters',"data[posters]", isset($data['posters'])? $data['posters'] : '',array("sizex"=>440,"sizey"=>440)) !!}
                                     </div>
 
                                 </div>
                                 <div class="form-group">
 
-                                 <label class="control-label col-sm-3">海报介绍语</label>
+                                 <label class="control-label col-sm-3">话术</label>
 
                                    <div class="col-sm-9">
-                                     <input id="data_introduce" name="data[introduce]" class="form-control" value="{{ $data['introduce'] or ''}}" required="" aria-required="true"  placeholder="">
+                                       <textarea id="data_words" name="data[words]" class="form-control"  required="" aria-required="true"  placeholder="">{{ $data['words'] ?? ''}}</textarea>
                                     </div>
 
                                 </div>
-                                <div class="form-group">
 
-                                    <label class="control-label col-sm-3">分享画面(1080*1080)</label>
-                                    <div class="col-sm-9">
-                                        {{--{!!  widget('Tools.ImgUpload')->single2('/upload/cover_pic','cover_pic',"cover_pic",  isset($data['cover_pic'])? $data['cover_pic'] : '',array("sizex"=>662,"sizey"=>510)) !!}--}}
-                                        {!!  widget('Tools.ImgUpload')->single2('/upload/share','share',"share",  isset($data['share'])? $data['share'] : '',array("sizex"=>1080,"sizey"=>1080)) !!}
-                                        <button type="button" onclick="layer.open({type: 2,area: ['80%', '90%'],content: '{{ U('Album/Poster/viewShare')}}'});"  class="btn btn-primary col-sm-offset-3">查看示例</button>
-                                    </div>
-                                </div>
-                                <div class="form-group">
 
-                                    <label class="control-label col-sm-3">分享标题</label>
+                               {{-- <div class="form-group">
 
+                                    <label class="control-label col-sm-3">海报二维码(140*140)</label>
                                     <div class="col-sm-9">
-                                        <input id="data_introduce" name="data[title]" class="form-control" value="{{ $data['title'] or ''}}" required="" aria-required="true"  placeholder="">
+                                        --}}{{--{!!  widget('Tools.ImgUpload')->single2('/upload/cover_pic','cover_pic',"cover_pic",  isset($data['cover_pic'])? $data['cover_pic'] : '',array("sizex"=>662,"sizey"=>510)) !!}--}}{{--
+                                        {!!  widget('Tools.ImgUpload')->single2('/upload/qrcode','qrcode',"qrcode",  isset($data['qrcode'])? $data['qrcode'] : '',array("sizex"=>140,"sizey"=>140)) !!}
                                     </div>
+                                </div>--}}
 
-                                </div>
-                                <div class="form-group">
 
-                                    <label class="control-label col-sm-3">海报二维码(140*140)</label>
+
+                                <div class="form-group">
+                                    <label class="control-label col-sm-3">分享视频</label>
                                     <div class="col-sm-9">
-                                        {{--{!!  widget('Tools.ImgUpload')->single2('/upload/cover_pic','cover_pic',"cover_pic",  isset($data['cover_pic'])? $data['cover_pic'] : '',array("sizex"=>662,"sizey"=>510)) !!}--}}
-                                        {!!  widget('Tools.ImgUpload')->single2('/upload/qrcode','qrcode',"qrcode",  isset($data['qrcode'])? $data['qrcode'] : '',array("sizex"=>140,"sizey"=>140)) !!}
+                                        <div style="height: auto;width: 200px;">
+                                            <video controls width="100px" height="100px">
+                                                <source src="{{$data['video_url'] ?? ''}}" type="video/mp4">
+                                            </video>
+                                        </div>
+                                        <input id="file-0b" class="file" type="file" name="video_url" value="">
                                     </div>
                                 </div>
                                 <div class="form-group">

+ 90 - 0
resources/views/admin/album/poster/index.blade.php

xqd
@@ -0,0 +1,90 @@
+@extends('admin.layout') 
+
+@section('content')
+<div class="wrapper wrapper-content animated fadeInRight">
+	<div class="row">
+		<div class="col-sm-12">
+			<div class="ibox float-e-margins">
+				<div class="ibox-title">
+					<h5>画册海报</h5>
+					<div class="ibox-tools">
+						<a class="collapse-link"> <i class="fa fa-chevron-up"></i>
+						</a>
+					</div>
+				</div>
+				<div class="ibox-content">
+				    <div class="row">
+				        <form method="GET" action="" accept-charset="UTF-8">
+
+				        <div class="col-sm-4">
+				            <div class="input-group">
+								<input type="text" value="{{Request::get('keyword')}}"	placeholder="请输入ID/备注" name="keyword" class="input-sm form-control">
+								<span class="input-group-btn">
+									<button type="submit" class="btn btn-sm btn-primary">搜索</button>
+								</span>
+    						</div>
+				        </div>
+				        </form>
+						@if(role('Album/Product/create'))
+    					<div class="col-sm-3 pull-right">
+    					   <a href="{{ U('Album/Poster/create')}}" class="btn btn-sm btn-primary pull-right">添加</a>
+    					</div>
+						@endif
+					</div>
+					
+					<table class="table table-striped table-bordered table-hover dataTables-example dataTable">
+						<thead>
+    						<tr>
+								
+            <th class="sorting" data-sort="id"> ID </th>
+            <th class="sorting" data-sort="name"> 名称 </th>
+            <th class="sorting" data-sort="share_type"> 文案类型 </th>
+        						<th width="22%">相关操作</th>
+        					</tr>
+						</thead>
+						<tbody>
+						@if(isset($list))
+							@foreach($list as $key => $item)							<tr>
+								
+            <td>{{ $item->id }}</td>
+            <td>{{ $item->name }}</td>
+								@if($item->share_type == 1)
+									<td>视频</td>
+								@else
+									<td>九张图</td>
+								@endif
+								<td>
+									<div class="pull-left">
+										@if(role('Album/Poster/update'))
+											<a href="{{ U('Album/Poster/update',['id'=>$item->id])}}" class="btn btn-sm btn-warning pull-right">修改</a>
+										@endif
+										@if(role('Album/Poster/destroy'))
+											<a href="{{ U('Album/Poster/destroy',['id'=>$item->id])}}" onclick="return confirm('你确定执行删除操作?');" class="btn btn-sm btn-danger pull-right">删除</a>
+										@endif
+									</div>
+								{{--@if(role('Album/Product/view'))
+										<button onclick="layer.open({type: 2,area: ['80%', '90%'],content: '{{ U('Album/Product/view',['id'=>$item->id])}}'});"  class="btn btn-primary ">查看大图</button>
+									@endif--}}
+								</td>
+							</tr>
+							@endforeach
+							@endif
+						</tbody>
+					</table>
+					<div class="row">
+						<div class="col-sm-6">
+							<div class="dataTables_info" id="DataTables_Table_0_info"
+								role="alert" aria-live="polite" aria-relevant="all">每页{{ $list->count() }}条,共{{ $list->lastPage() }}页,总{{ $list->total() }}条。</div>
+						</div>
+						<div class="col-sm-6">
+						<div class="dataTables_paginate paging_simple_numbers" id="DataTables_Table_0_paginate">
+						{!! $list->setPath('')->appends(Request::all())->render() !!}
+						</div>
+						</div>
+					</div>
+				</div>
+			</div>
+		</div>
+	</div>
+</div>
+@endsection

+ 17 - 9
resources/views/admin/album/product/edit.blade.php

xqd xqd xqd xqd
@@ -1,10 +1,10 @@
 @extends('admin.layout')
 @section('header')
 
-    <link href="/base/css/fileinput.css" media="all" rel="stylesheet" type="text/css" />
+    <link href="{{ session()->get('is_we7')=='true'?'/addons/furnitureWe7/public':'' }}/base/css/fileinput.css" media="all" rel="stylesheet" type="text/css" />
 
-    <script src="/base/js/fileinput.js" type="text/javascript"></script>
-    <script src="/base/js/fileinput_locale_zh.js" type="text/javascript"></script>
+    <script src="{{ session()->get('is_we7')=='true'?'/addons/furnitureWe7/public':'' }}/base/js/fileinput.js" type="text/javascript"></script>
+    <script src="{{ session()->get('is_we7')=='true'?'/addons/furnitureWe7/public':'' }}/base/js/fileinput_locale_zh.js" type="text/javascript"></script>
 
 @endsection
 @section('content')
@@ -101,7 +101,8 @@
                                     <div class="form-group">
                                         <label class="control-label col-sm-3">排序</label>
                                         <div class="col-sm-9">
-                                            <input id="data_sort" name="data[sort]" class="form-control" value="{{ $data['sort'] or ''}}" required="" aria-required="true"  placeholder="数值越大越靠前">
+                                            <input id="data_sort" name="data[sort]" class="form-control" value="{{ $data['sort'] or '0'}}" required="" aria-required="true"  placeholder="数值越大越靠前">
+                                            <span class="help-block m-b-none">数值越大越靠前</span>
                                         </div>
                                     </div>
 
@@ -125,7 +126,10 @@
                                     </div>
                                     <div class="form-group">
 
-                                        <label class="control-label col-sm-3">尺寸图片(1920*1080)</label>
+                                        <label class="control-label col-sm-3">尺寸图片
+                                            <br/>
+                                            <small class="text-navy">(1920像素 * 1080像素)</small>
+                                            </label>
                                         <div class="col-sm-9">
                                             {{--{!!  widget('Tools.ImgUpload')->single2('/upload/attr','attr',"attr",  isset($data['attr'])? $data['attr'] : '',array("sizex"=>1920,"sizey"=>1080)) !!}--}}
                                             {!!  widget('Tools.ImgUpload')->multi2('/upload/specifications_img','specifications_img',"data[specifications_img]",  isset($data['specifications_img'])? $data['specifications_img'] : '',array("sizex"=>1920,"sizey"=>1080)) !!}
@@ -134,28 +138,32 @@
 
                                     <div class="form-group">
 
-                                        <label class="control-label col-sm-3">安装图片(1920*1080)</label>
+                                        <label class="control-label col-sm-3">安装图片<br/>
+                                            <small class="text-navy">(1920像素 * 1080像素)</small></label>
                                         <div class="col-sm-9">
                                             {!!  widget('Tools.ImgUpload')->multi2('/upload/install_img','install_img',"data[install_img]",  isset($data['install_img'])? $data['install_img'] : '',array("sizex"=>1920,"sizey"=>1080)) !!}
                                         </div>
                                     </div>
 
                                     <div class="form-group">
-                                        <label class="control-label col-sm-3">封面图片(480*270)</label>
+                                        <label class="control-label col-sm-3">封面图片<br/>
+                                            <small class="text-navy">(480像素 * 270像素)</small></label>
                                         <div class="col-sm-9">
                                             {{--{!!  widget('Tools.ImgUpload')->single2('/upload/cover_pic','cover_pic',"cover_pic",  isset($data['cover_pic'])? $data['cover_pic'] : '',array("sizex"=>662,"sizey"=>510)) !!}--}}
                                             {!!  widget('Tools.ImgUpload')->single2('/upload/thumb','thumb',"thumb",  isset($data['thumb'])? $data['thumb'] : '',array("sizex"=>480,"sizey"=>270)) !!}
                                         </div>
                                     </div>
                                     <div class="form-group">
-                                        <label class="control-label col-sm-3">封面图片(高清1920*1080)</label>
+                                        <label class="control-label col-sm-3">封面图片<br/>
+                                            <small class="text-navy">高清:(1920像素 * 1080像素)</small></label>
                                         <div class="col-sm-9">
                                             {{--{!!  widget('Tools.ImgUpload')->single2('/upload/cover_pic','cover_pic',"cover_pic",  isset($data['cover_pic'])? $data['cover_pic'] : '',array("sizex"=>662,"sizey"=>510)) !!}--}}
                                             {!!  widget('Tools.ImgUpload')->single2('/upload/cover_pic','cover_pic',"cover_pic",  isset($data['cover_pic'])? $data['cover_pic'] : '',array("sizex"=>1920,"sizey"=>1080)) !!}
                                         </div>
                                     </div>
                                     <div class="form-group">
-                                        <label class="control-label col-sm-3">搭配图片(1920*1080)</label>
+                                        <label class="control-label col-sm-3">搭配图片<br/>
+                                            <small class="text-navy">(1920像素 * 1080像素)</small></label>
                                         <div class="col-sm-9">
                                             {!!  widget('Tools.ImgUpload')->single2('/upload/detail_pic','detail_pic',"detail_pic",  isset($data['detail_pic'])? $data['detail_pic'] : '',array("sizex"=>1920,"sizey"=>1080)) !!}
                                         </div>

+ 106 - 0
resources/views/admin/album/user/album-index.blade.php

xqd
@@ -0,0 +1,106 @@
+@extends('admin.layout')
+
+@section('content')
+    <div class="wrapper wrapper-content animated fadeInRight">
+        <div class="row">
+            <div class="col-sm-12">
+                <div class="ibox float-e-margins">
+                    <div class="ibox-title">
+                        <h5>用户管理</h5>
+                        <div class="ibox-tools">
+                            <a class="collapse-link"> <i class="fa fa-chevron-up"></i>
+                            </a>
+                        </div>
+                    </div>
+                    <div class="ibox-content">
+                        <div class="row">
+                            <form method="GET" action="" accept-charset="UTF-8">
+
+                                <div class="col-sm-8">
+                                    <div class="form-group col-sm-5" >
+                                        <label class="radio-inline">
+                                            <input type="radio" name="is_boss" value="-1"
+                                                   @if(empty(Request::get('is_boss')) || Request::get('is_boss') == '-1')checked="checked" @endif/>全部
+                                        </label>
+                                        <label class="radio-inline">
+                                            <input type="radio" name="is_boss" value="0"
+                                                   @if(!empty(Request::get('is_boss')) && Request::get('is_boss') == '0')checked="checked" @endif/>普通用户
+                                        </label>
+                                        <label class="radio-inline">
+                                            <input type="radio" name="is_boss" value="1"
+                                                   @if(!empty(Request::get('is_boss')) && Request::get('is_boss') == '1')checked="checked" @endif/>经销商
+                                        </label>
+                                    </div>
+                                    <div class="input-group col-sm-4">
+                                        <input type="text" value="{{Request::get('keyword')}}" placeholder="请输入昵称/电话"
+                                               name="keyword" class="input-sm form-control">
+                                        <span class="input-group-btn">
+									<button type="submit" class="btn btn-sm btn-primary">搜索</button>
+								</span>
+                                    </div>
+                                </div>
+                            </form>
+                        </div>
+
+                        <table class="table table-striped table-bordered table-hover dataTables-example dataTable">
+                            <thead>
+                            <tr>
+
+                                <th class="sorting" data-sort="id">ID</th>
+                                <th class="sorting" data-sort="username"> 微信昵称 </th>
+                                <th class="sorting" data-sort="avatar"> 用户头像</th>
+                                <th class="sorting" data-sort="phone"> 电话</th>
+                                <th class="sorting" data-sort="is_dealer"> 画册角色</th>
+                                <th class="sorting" data-sort="created_at"> 加入时间</th>
+                                <th width="22%">相关操作</th>
+                            </tr>
+                            </thead>
+                            <tbody>
+                            @if(isset($list))
+                                @foreach($list as $key => $item)
+                                    <tr>
+
+                                        <td>{{ $item->id }}</td>
+                                        <td>{{ $item->username }}</td>
+                                        <td><img src="{{ $item->avatar }}" width="50px"/></td>
+                                        <td>{{ $item->phone }}</td>
+                                        @if($item['is_dealer'] == 1)
+                                            <td>画册经销商</td>
+                                        @else
+                                            <td>普通用户</td>
+                                        @endif
+                                        <td>{{ $item->created_at }}</td>
+                                        <td>
+                                            @if(role('Album/User/update'))
+                                                @if($item->is_dealer != 1)
+                                                    <button onclick="window.location.href='{{ U('Album/User/update',['id'=>$item->id]) }}'"
+                                                            class="btn btn-warning">设为经销商
+                                                    </button>
+                                                @endif
+                                            @endif
+                                        </td>
+                                    </tr>
+                                @endforeach
+                            @endif
+
+                            </tbody>
+                        </table>
+                        <div class="row">
+                            <div class="col-sm-6">
+                                <div class="dataTables_info" id="DataTables_Table_0_info"
+                                     role="alert" aria-live="polite" aria-relevant="all">每页{{ $list->count() }}
+                                    条,共{{ $list->lastPage() }}页,总{{ $list->total() }}条。
+                                </div>
+                            </div>
+                            <div class="col-sm-6">
+                                <div class="dataTables_paginate paging_simple_numbers" id="DataTables_Table_0_paginate">
+                                    {!! $list->setPath('')->appends(Request::all())->render() !!}
+                                </div>
+                            </div>
+                        </div>
+                    </div>
+                </div>
+            </div>
+        </div>
+    </div>
+@endsection

+ 0 - 133
resources/views/admin/album/user/edit.blade.php

xqd
@@ -1,133 +0,0 @@
-@extends('admin.layout')
-
-@section('content')
-
-<?php
-    if(!isset($data)) $data = array();
-    if(!$data && session("data")){
-        $data = session("data");
-    }
-    if(!$data && session('_old_input')){
-        $data = session("_old_input");
-    }
-?>
-<div class="wrapper wrapper-content animated fadeInRight">
-	<div class="row">
-		<div class="col-sm-12">
-			<div class="ibox float-e-margins">
-				<div class="ibox-title">
-					<h5>用户管理</h5>
-					<div class="ibox-tools">
-						<a class="collapse-link"> <i class="fa fa-chevron-up"></i>
-						</a>
-					</div>
-				</div>
-				<div class="ibox-content">
-                    @if(role('Album/User/index'))
-				    <div class="row">
-    					<div class="col-sm-3 pull-right">
-    					   <a href="{{ U('Album/User/index')}}" class="btn btn-sm btn-primary pull-right">返回列表</a>
-    					</div>
-					</div>
-                    @endif
-
-		            <div class="row">
-                        <div class="col-lg-10">
-                            <form name="form_product" id="form-validation" action="" class="form-horizontal form-validation" accept-charset="UTF-8" method="post">
-
-                                    
-                <div class="form-group">
-                                    
-                 <label class="control-label col-sm-3">名称</label>
-                                    
-                   <div class="col-sm-9">
-                     <input id="data_username" name="data[username]" class="form-control" value="{{ $data['username'] or ''}}" required="" aria-required="true"  placeholder=""> 
-                    </div>
-                                
-                </div>    
-                <div class="form-group">
-                                    
-                 <label class="control-label col-sm-3">微信open_id</label>
-                                    
-                   <div class="col-sm-9">
-                     <input id="data_wechat_open_id" name="data[wechat_open_id]" class="form-control" value="{{ $data['wechat_open_id'] or ''}}" required="" aria-required="true"  placeholder=""> 
-                    </div>
-                                
-                </div>    
-                <div class="form-group">
-                                    
-                 <label class="control-label col-sm-3">微信union_id</label>
-                                    
-                   <div class="col-sm-9">
-                     <input id="data_wechat_union_id" name="data[wechat_union_id]" class="form-control" value="{{ $data['wechat_union_id'] or ''}}" required="" aria-required="true"  placeholder=""> 
-                    </div>
-                                
-                </div>    
-                <div class="form-group">
-                                    
-                 <label class="control-label col-sm-3">头像链接</label>
-                                    
-                   <div class="col-sm-9">
-                     <input id="data_avatar" name="data[avatar]" class="form-control" value="{{ $data['avatar'] or ''}}" required="" aria-required="true"  placeholder=""> 
-                    </div>
-                                
-                </div>    
-                <div class="form-group">
-                                    
-                 <label class="control-label col-sm-3">Is_delete</label>
-                                    
-                   <div class="col-sm-9">
-                     <input id="data_is_delete" name="data[is_delete]" class="form-control" value="{{ $data['is_delete'] or ''}}" required="" aria-required="true"  placeholder=""> 
-                    </div>
-                                
-                </div>    
-                <div class="form-group">
-                                    
-                 <label class="control-label col-sm-3">商户号</label>
-                                    
-                   <div class="col-sm-9">
-                     <input id="data_store_id" name="data[store_id]" class="form-control" value="{{ $data['store_id'] or ''}}" required="" aria-required="true"  placeholder=""> 
-                    </div>
-                                
-                </div>    
-                <div class="form-group">
-                                    
-                 <label class="control-label col-sm-3">是否为经销商</label>
-                                    
-                   <div class="col-sm-9">
-                     <input id="data_is_dealer" name="data[is_dealer]" class="form-control" value="{{ $data['is_dealer'] or ''}}" required="" aria-required="true"  placeholder=""> 
-                    </div>
-                                
-                </div>    
-                <div class="form-group">
-                                    
-                 <label class="control-label col-sm-3">电话</label>
-                                    
-                   <div class="col-sm-9">
-                     <input id="data_phone" name="data[phone]" class="form-control" value="{{ $data['phone'] or ''}}" required="" aria-required="true"  placeholder=""> 
-                    </div>
-                                
-                </div>
-                                
-                                <div class="form-group">
-                                    <label class="control-label col-sm-3">&nbsp;</label>
-                                    <div class="col-sm-9">
-                                        <input type="hidden" name="_referer" value="<?php echo urlencode(request()->server('HTTP_REFERER'));?>"/>
-                                        <input type="hidden" name="_token" value="<?php echo csrf_token(); ?>"/>
-                                        <input type="submit" class="btn btn-success" style="margin-right:20px;">
-                                        <input type="reset" class="btn btn-default" >
-                                    </div>
-                                </div>
-        
-                            </form>
-                        </div>
-                        <!-- /.col-lg-10 -->
-                    </div>
-                    <!-- /.row -->
-				</div>
-			</div>
-		</div>
-	</div>
-</div>
-
-@endsection

+ 28 - 18
resources/views/admin/album/user/index.blade.php → resources/views/admin/album/user/furniture-index.blade.php

xqd xqd xqd
@@ -16,9 +16,33 @@
                         <div class="row">
                             <form method="GET" action="" accept-charset="UTF-8">
 
-                                <div class="col-sm-4">
-                                    <div class="input-group">
-                                        <input type="text" value="{{Request::get('keyword')}}" placeholder="请输入昵称/openid/电话"
+                                <div class="col-sm-8">
+
+
+                                    <div class="form-group col-sm-8" >
+                                        <label class="radio-inline">
+                                            <input type="radio" name="role" value="-1"
+                                                   @if(empty(Request::get('role')) || Request::get('role') == '-1')checked="checked" @endif/>全部
+                                        </label>
+                                        <label class="radio-inline">
+                                            <input type="radio" name="role" value="0"
+                                                   @if(!empty(Request::get('role')) && Request::get('role') == '0')checked="checked" @endif/>普通用户
+                                        </label>
+                                        <label class="radio-inline">
+                                            <input type="radio" name="role" value="1"
+                                                   @if(!empty(Request::get('role')) && Request::get('role') == '1')checked="checked" @endif/>生产部
+                                        </label>
+                                        <label class="radio-inline">
+                                            <input type="radio" name="role" value="2"
+                                                   @if(!empty(Request::get('role')) && Request::get('role') == '2')checked="checked" @endif/>包装部
+                                        </label>
+                                        <label class="radio-inline">
+                                            <input type="radio" name="role" value="3"
+                                                   @if(!empty(Request::get('role')) && Request::get('role') == '3')checked="checked" @endif/>经理
+                                        </label>
+                                    </div>
+                                    <div class="input-group col-sm-4">
+                                        <input type="text" value="{{Request::get('keyword')}}" placeholder="请输入昵称/电话"
                                                name="keyword" class="input-sm form-control">
                                         <span class="input-group-btn">
 									<button type="submit" class="btn btn-sm btn-primary">搜索</button>
@@ -31,14 +55,12 @@
                         <table class="table table-striped table-bordered table-hover dataTables-example dataTable">
                             <thead>
                             <tr>
-
                                 <th class="sorting" data-sort="id">ID</th>
                                 <th class="sorting" data-sort="username"> 微信昵称 </th>
                                 <th class="sorting" data-sort="avatar"> 用户头像</th>
                                 <th class="sorting" data-sort="phone"> 电话</th>
-                                <th class="sorting" data-sort="is_dealer"> 用户类型</th>
+                                <th class="sorting" data-sort="is_dealer"> 售后角色</th>
                                 <th class="sorting" data-sort="created_at"> 加入时间</th>
-                                <th class="sorting" data-sort="role">角色</th>
                                 <th width="22%">相关操作</th>
                             </tr>
                             </thead>
@@ -51,21 +73,9 @@
                                         <td>{{ $item->username }}</td>
                                         <td><img src="{{ $item->avatar }}" width="50px"/></td>
                                         <td>{{ $item->phone }}</td>
-                                        @if($item['is_dealer'] == 1&&$item['model']==1)
-                                            <td>画册经销商</td>
-                                        @else
-                                            <td>普通用户</td>
-                                        @endif
                                         <td>{{ $item->created_at }}</td>
                                         <td>{{ $item->role() }}</td>
                                         <td>
-                                            @if(role('Album/User/update'))
-                                                @if($item->is_dealer != 1)
-                                                    <button onclick="window.location.href='{{ U('Album/User/update',['id'=>$item->id]) }}'"
-                                                            class="btn btn-warning">设为经销商
-                                                    </button>
-                                                @endif
-                                            @endif
                                             @if(role('Album/User/role'))
                                                     @if($item->role !== 0)
                                                         <button onclick="window.location.href='{{ U('Album/User/role',['id'=>$item->id,'role'=>0]) }}'"

+ 11 - 9
resources/views/admin/base/user/edit.blade.php

xqd
@@ -52,20 +52,22 @@
 
                                 </div>
 
+                                @if($data['is_root'] == 1)
+                                    <div class="form-group">
 
-                                <div class="form-group">
+                                        <label class="control-label col-sm-3">选择商户 </label>
 
-                                    <label class="control-label col-sm-3">选择商户 </label>
+                                        <div class="col-sm-6">
+                                            <input id="data_store" class="form-control" v-model="checkstore.name"   readonly placeholder="">
+                                            <input id="data_store_id" type="hidden" name="info[store_id]" v-model="checkstore.id"  required="" aria-required="true"  placeholder="">
+                                        </div>
 
-                                    <div class="col-sm-6">
-                                        <input id="data_store" class="form-control" v-model="checkstore.name"   readonly placeholder="">
-                                        <input id="data_store_id" type="hidden" name="info[store_id]" v-model="checkstore.id"  required="" aria-required="true"  placeholder="">
+                                        <div class="col-sm-3">
+                                            <button type="button" class="btn btn-w-m btn-primary" data-toggle="modal" data-target="#myModal5" onclick="SearchStore()" @if(!empty($data['mobile'])) disabled="disabled" @endif>选择</button>
+                                        </div>
                                     </div>
+                                @endif
 
-                                    <div class="col-sm-3">
-                                        <button type="button" class="btn btn-w-m btn-primary" data-toggle="modal" data-target="#myModal5" onclick="SearchStore()" @if(!empty($data['mobile'])) disabled="disabled" @endif>选择</button>
-                                    </div>
-                                </div>
                                 <div class="form-group">
                                     <label class="control-label col-sm-3">密码</label>
                                     <div class="col-sm-9">

+ 8 - 13
resources/views/admin/base/user/index.blade.php

xqd
@@ -64,19 +64,14 @@
 								    ?>								
 								</td>
 								<td>
-									<div class="btn-group">
-										<button data-toggle="dropdown" class="btn btn-warning btn-sm dropdown-toggle" aria-expanded="false">
-											操作 <span class="caret"></span>
-										</button>
-										<ul class="dropdown-menu">
-											@if(role('Foundation/User/update'))
-												<li><a href="{{ U('Base/User/update')}}?id={{ $item->id }}" class="font-bold">修改</a></li>
-											@endif
-											@if(role('Base/User/destroy'))
-												<li class="divider"></li>
-												<li><a href="{{ U('Base/User/destroy',['id'=>$item->id])}}" onclick="return confirm('你确定执行删除操作?');">删除</a></li>
-											@endif
-										</ul>
+									<div class="pull-left">
+										@if(role('Base/User/update'))
+											<a href="{{ U('Base/User/update')}}?id={{ $item->id }}" class="btn btn-sm btn-warning pull-right">修改</a>
+										@endif
+										@if(role('Base/User/destroy'))
+											<a href="{{ U('Base/User/destroy',['id'=>$item->id])}}" onclick="return confirm('你确定执行删除操作?');" class="btn btn-sm btn-danger pull-right">删除</a>
+										@endif
+
 									</div>
 								</td>
 							</tr>

+ 2 - 1
resources/views/admin/furniture/goods/category/edit.blade.php

xqd
@@ -95,8 +95,9 @@
 
                                         <div class="col-sm-9">
                                             <input id="data_sort" name="data[sort]" class="form-control"
-                                                   value="{{ $data['sort'] or ''}}" required="" aria-required="true"
+                                                   value="{{ $data['sort'] or '0'}}" required="" aria-required="true"
                                                    placeholder="数值越大越靠前">
+                                            <span class="help-block m-b-none">数值越大越靠前</span>
                                         </div>
 
                                     </div>

+ 2 - 1
resources/views/admin/furniture/goods/edit.blade.php

xqd
@@ -95,8 +95,9 @@
 
                                         <div class="col-sm-9">
                                             <input id="data_sort" name="data[sort]" class="form-control"
-                                                   value="{{ $data['sort'] or ''}}" required="" aria-required="true"
+                                                   value="{{ $data['sort'] or '0'}}" required="" aria-required="true"
                                                    placeholder="数值越大越靠前">
+                                            <span class="help-block m-b-none">数值越大越靠前</span>
                                         </div>
 
                                     </div>

+ 6 - 1
resources/views/admin/furniture/newgoods/comment/index.blade.php

xqd
@@ -64,11 +64,16 @@
                                         <td>
                                             <div class="pull-left">
                                                 @if(role('Furniture/Newgoods/Comment/update'))
-                                                    <a href="{{ U('Furniture/Newgoods/Comment/update',['id'=>$item->id])}}" class="btn btn-sm btn-warning pull-right">修改</a>
+                                                    <a href="{{ U('Furniture/Newgoods/Comment/update',['id'=>$item->id])}}" class="btn btn-sm btn-warning pull-right">回复</a>
                                                 @endif
                                                 @if(role('Furniture/Newgoods/Comment/destroy'))
                                                     <a href="{{ U('Furniture/Newgoods/Comment/destroy',['id'=>$item->id])}}" onclick="return confirm('你确定执行删除操作?');" class="btn btn-sm btn-danger pull-right">删除</a>
                                                 @endif
+                                                    @if(role('Furniture/Newgoods/Comment/view'))
+                                                        <a onclick="layer.open({type: 2,area: ['80%', '90%'],content: '{{ U('Furniture/Newgoods/Comment/view',['id'=>$item->id])}}'});"
+                                                           class="btn btn-sm btn-primary pull-right">查看
+                                                        </a>
+                                                    @endif
                                             </div>
                                        {{--     @if(role('Furniture/Newgoods/Comment/view'))
                                                 <button onclick="layer.open({type: 2,area: ['80%', '90%'],content: '{{ U('Furniture/Newgoods/Comment/view',['id'=>$item->id])}}'});"

+ 0 - 51
resources/views/admin/furniture/newgoods/comment/view.blade.php

xqd xqd xqd
@@ -5,13 +5,6 @@
         <div class="ibox-content">
             <div class="list-group">
 
-                <div class="list-group-item">
-
-                    <h3 class="list-group-item-heading">ID</h3>
-
-                    <p class="list-group-item-text"> {{ $data['id'] or ''}}</p>
-
-                </div>
                 <div class="list-group-item">
 
                     <h3 class="list-group-item-heading">用户</h3>
@@ -19,41 +12,7 @@
                     <p class="list-group-item-text"> {{ $data->user->username or ''}}</p>
 
                 </div>
-                <div class="list-group-item">
-
-                    <h3 class="list-group-item-heading">新品</h3>
 
-                    <p class="list-group-item-text"> {{ $data->newgoods->title or ''}}</p>
-
-                </div>
-                <div class="list-group-item">
-
-                    <h3 class="list-group-item-heading">{{$data->newgoods->comments_field_1}}</h3>
-
-                    <p class="list-group-item-text"> {{ $data['comments_field_1'] or ''}}</p>
-
-                </div>
-                <div class="list-group-item">
-
-                    <h3 class="list-group-item-heading">{{$data->newgoods->comments_field_2}}</h3>
-
-                    <p class="list-group-item-text"> {{ $data['comments_field_2'] or ''}}</p>
-
-                </div>
-                <div class="list-group-item">
-
-                    <h3 class="list-group-item-heading">{{$data->newgoods->comments_field_3}}</h3>
-
-                    <p class="list-group-item-text"> {{ $data['comments_field_3'] or ''}}</p>
-
-                </div>
-                <div class="list-group-item">
-
-                    <h3 class="list-group-item-heading">{{$data->newgoods->comments_field_4}}</h3>
-
-                    <p class="list-group-item-text"> {{ $data['comments_field_4'] or ''}}</p>
-
-                </div>
                 <div class="list-group-item">
 
                     <h3 class="list-group-item-heading">评论详情</h3>
@@ -70,17 +29,7 @@
 
                 </div>
 
-                <div class="list-group-item">
-
-                    <h3 class="list-group-item-heading">图片</h3>
 
-                    <p class="list-group-item-text">
-                        @foreach($data->picture as $item)
-                            <img src="{{$item}}" alt="" style="height: 80px;margin-right: 10px">
-                        @endforeach
-                    </p>
-
-                </div>
 
                 <div class="list-group-item">
 

+ 1 - 1
resources/views/admin/furniture/newgoods/info/booking.blade.php

xqd
@@ -120,7 +120,7 @@
         $('.myModal1').click(function () {
             var booking = $(this).attr('data-id');
             var remark = $(this).attr('data-content');
-            $('#form-validation-1').attr('action', "/admin/furnitureWe7/Newgoods/Info/bookingremark?id=" + booking)
+            $('#form-validation-1').attr('action', "/admin/Furniture/Newgoods/Info/bookingremark?id=" + booking)
             $('#remark').val(remark)
         })
     </script>

+ 3 - 2
resources/views/admin/furniture/newgoods/info/edit.blade.php

xqd
@@ -105,10 +105,11 @@
                 </div>    
                 <div class="form-group">
                                     
-                 <label class="control-label col-sm-3">排序,越大越靠前</label>
+                 <label class="control-label col-sm-3">排序</label>
                                     
                    <div class="col-sm-9">
-                     <input id="data_sort" name="data[sort]" class="form-control" value="{{ $data['sort'] or ''}}" required="" aria-required="true"  placeholder=""> 
+                     <input id="data_sort" name="data[sort]" class="form-control" value="{{ $data['sort'] or 0}}" required="" aria-required="true"  placeholder="">
+                       <span class="help-block m-b-none">数值越大越靠前</span>
                     </div>
                                 
                 </div>

+ 8 - 22
resources/views/admin/furniture/newgoods/info/index.blade.php

xqd
@@ -57,30 +57,16 @@
                                         <td>{{ $item->created_at }}</td>
                                         <td>{{ $item->updated_at }}</td>
                                         <td>
-                                            <div class="btn-group">
-                                                <button data-toggle="dropdown"
-                                                        class="btn btn-warning btn-sm dropdown-toggle"
-                                                        aria-expanded="false">
-                                                    操作 <span class="caret"></span>
-                                                </button>
-                                                <ul class="dropdown-menu">
-
-
-                                                    @if(role('Furniture/Newgoods/Info/update'))
-                                                        <li>
-                                                            <a href="{{ U('Furniture/Newgoods/Info/update',['id'=>$item->id])}}"
-                                                               class="font-bold">修改</a></li>
-                                                    @endif
+                                            @if(role('Furniture/Newgoods/Info/update'))
+                                                    <a href="{{ U('Furniture/Newgoods/Info/update',['id'=>$item->id])}}"
+                                                       class="btn btn-sm btn-warning">修改</a>
+                                            @endif
 
-                                                    @if(role('Furniture/Newgoods/Info/destroy'))
-                                                        <li class="divider"></li>
-                                                        <li>
-                                                            <a href="{{ U('Furniture/Newgoods/Info/destroy',['id'=>$item->id])}}"
-                                                               onclick="return confirm('你确定执行删除操作?');">删除</a></li>
-                                                    @endif
+                                            @if(role('Furniture/Newgoods/Info/destroy'))
 
-                                                </ul>
-                                            </div>
+                                                    <a href="{{ U('Furniture/Newgoods/Info/destroy',['id'=>$item->id])}}"
+                                                       class="btn btn-sm btn-danger">删除</a>
+                                            @endif
                                             @if(role('Furniture/Newgoods/Info/view'))
                                                 <button onclick="layer.open({type: 2,area: ['80%', '90%'],content: '{{ U('Furniture/Newgoods/Info/view',['id'=>$item->id])}}'});"
                                                         class="btn btn-primary ">查看