dyjh 6 år sedan
förälder
incheckning
0aec1403a4

+ 12 - 13
app/Http/Controllers/Admin/Album/AgentController.php

xqd
@@ -56,26 +56,25 @@ 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'));
     }
 
-    public function batch()
+    public function batch(Request $request)
     {
-        
-    }
-
-    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'];
+        $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' => []]);
+    }
 
     /**
      * 添加

+ 53 - 1
app/Http/Controllers/Admin/Album/ManufacturerController.php

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,57 @@ class ManufacturerController extends Controller
         return view('admin.album.manufacturer.edit', compact('data', 'video'));
     }
 
+    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 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();

+ 73 - 5
app/Http/Controllers/Admin/Album/PosterController.php

xqd xqd xqd xqd xqd
@@ -9,6 +9,8 @@
 namespace App\Http\Controllers\Admin\Album;
 use App\Http\Controllers\Admin\Controller;
 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 +26,36 @@ class PosterController extends Controller
         }
     }
 
+    function index(Request $request)
+    {
+        $search['keyword'] = $request->input('keyword');
+        $query = $this->repository->pushCriteria(new ProductWhere($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();
+        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'));
+    }
+
     /**
      * 修改
      */
@@ -36,7 +68,7 @@ class PosterController extends Controller
         if (!empty($data)) {
             $data = $data[0];
             $data['posters'] = json_decode($data['posters'], true);
-            $data['banners'] = json_decode($data['banners'], true);
+            $data['banner'] = json_decode($data['banner'], true);
             $data['words'] = json_decode($data['words'], true);
         }
         return view('admin.album.poster.edit', compact('data'));
@@ -48,17 +80,20 @@ class PosterController extends Controller
     private function updateSave()
     {
         $data = (array) request('data');
+        if (isset($data['video_url'])) {
+            $data['video_url'] = $this->uploadVideo($data['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['banners']['url'])) {
-            foreach ($data['banners']['url'] as $key => $val) {
-                $data['banners']['url'][$key] = $this->formatImgUrl($val);
+        if (!empty($data['banner']['url'])) {
+            foreach ($data['banner']['url'] as $key => $val) {
+                $data['banner']['url'][$key] = $this->formatImgUrl($val);
             }
-            $data['banners'] = json_encode($data['banners']['url']);
+            $data['banner'] = json_encode($data['banner']['url']);
         }
         if (empty($data['share']) || empty($data['qrcode'])) {
             return $this->showMessage('分享海报或者二维码不能为空!');
@@ -82,6 +117,39 @@ 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->upload_video, true);
+                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)
     {

+ 3 - 16
app/Http/Controllers/Admin/Album/ProductController.php

xqd xqd xqd
@@ -12,6 +12,7 @@ use App\Models\AlbumCatModel;
 use App\Models\AlbumProductModel;
 use App\Models\AlbumProductPriceModel;
 use App\Models\AlbumProductStyleModel;
+use App\Repositories\Album\Criteria\PosterWhere;
 use App\Repositories\Album\Criteria\ProductWhere;
 use App\Services\OSS;
 use Illuminate\Http\Request;
@@ -37,7 +38,7 @@ class ProductController extends Controller
     function index(Request $request)
     {
         $search['keyword'] = $request->input('keyword');
-        $query = $this->repository->pushCriteria(new ProductWhere($search, $this->getStoreId()));
+        $query = $this->repository->pushCriteria(new PosterWhere($search, $this->getStoreId()));
 
 
         if (isset($request['sort_field']) && $request['sort_field'] && isset($request['sort_field_by'])) {
@@ -46,22 +47,8 @@ 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'));
+        return view('admin.album.poster.index', compact('list'));
     }
 
     /**

+ 14 - 80
app/Http/Controllers/Admin/Album/UserController.php

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,93 +38,27 @@ 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'];
-        }
-        $list = $this->repository->search($search,$orderby);
-        return view('admin.album.user.check',compact('list'));
-    }
-
-
-    /**
-     * 添加
-     * 
-     */
-    public function create(Request $request)
-    {
-        if($request->method() == 'POST') {
-            return $this->_createSave();
-        }
-        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);
+            $order[$request['sort_field']] = $request['sort_field_by'];
         }else{
-            $url[] = array('url'=>U( 'Album/User/index'),'title'=>'返回列表');
-            return $this->showWarning('添加失败',$url);
-        }
-    }
-    
-    /**
-     * 
-     * 修改
-     * 
-     * 
-     */
-    public function update(Request $request) {
-        $data = $this->repository->find($request->get('id'));
-        if($data->is_dealer == 1){
-            return $this->showWarning('该用户已成为经销商');
+            $order['id']='DESC';
         }
-        $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('操作成功');
-            }else{
-                return $this->showWarning('操作失败');
-            }
-        }
-        return view('admin.album.user.edit',compact('data'));
+        $list = $this->repository->searchUser($search,$order);
+        //dd($list);
+//        dump($list);die;
+        return view('admin.album.user.album-index',compact('list'));
     }
 
-    /**
-     * 保存修改
-     */
-    private function _updateSave() {
-        $data = (array) request('data');
-        $ok = $this->repository->update(request('id'),$data);
-        if($ok) {
-            $url[] = array('url'=>U( 'Album/User/index'),'title'=>'返回列表');
-            return $this->showMessage('操作成功',urldecode(request('_referer')));
-        }else{
-            $url[] = array('url'=>U( 'Album/User/index'),'title'=>'返回列表');
-            return $this->showWarning('操作失败',$url);
-        }
-    }
+
 
     public function view(Request $request) {
         $data = $this->repository->find(request('id'));

+ 16 - 105
app/Http/Controllers/Api/V1/AlbumPosterController.php

xqd xqd xqd
@@ -164,49 +164,8 @@ class AlbumPosterController extends Controller
         }
     }
 
-    /**
-     * @api {post} /api/album_post/create 生成海报(create)
-     * @apiDescription 生成海报(create)
-     * @apiGroup Album_Post
-     * @apiPermission 需要登录
-     * @apiVersion 0.1.0
-     * @apiParam {int}    [store_id]  商户id
-     * @apiParam {string}    [image]  图片
-     * @apiSuccessExample {json} Success-Response:
-     * HTTP/1.1 200 OK
-     * {
-     *     "status": true,
-     *     "status_code": 0,
-     *     "message": "",
-     *     "data": [
-     *           'real_url':'asdawd',  //海报
-     *      ]
-     * }
-     * @apiErrorExample {json} Error-Response:
-     * HTTP/1.1 400 Bad Request
-     * {
-     *     "state": false,
-     *     "code": 1000,
-     *     "message": "传入参数不正确",
-     *     "data": null or []
-     * }
-     * 可能出现的错误代码:
-     *    1000    CLIENT_WRONG_PARAMS             传入参数不正确
-     */
-    public function createPoster(Request $request)
+    private function createPoster($userAuth, $store_id)
     {
-        $userAuth = Auth('api')->user();
-
-        $validator = Validator::make($request->all(), [
-            'store_id' => 'required',
-            'image' => 'required',
-        ], [
-            'store_id.required' => '店铺信息未知',
-            'image' => '缺少图片链接'
-        ]);
-        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'];
@@ -214,13 +173,12 @@ class AlbumPosterController extends Controller
             $agent_id = $userAuth->up_agent_id == 0 ? 0 : $userAuth->up_agent_id;
         }
 
-        $data = $request->input();
 
         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'] = $data['store_id'];
+            $add_record['store_id'] = $store_id;
             $add_record['detail'] = '保存了图片';
             $user_agent = AlbumAgentModel::where('id', $userAuth->up_agent_id)->first();
             $user_agent->share_times++;
@@ -231,76 +189,29 @@ class AlbumPosterController extends Controller
             AlbumWatchRecord::create($add_record);
         }
 
-        $info = AlbumPosterModel::where('store_id', $data['store_id'])->first()->toArray();
+        $info = AlbumPosterModel::where('store_id', $store_id)->first()->toArray();
         $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->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']);
-            if ($len <= 17) {
-                $editor->text($image_poster, $info['introduce'], 19, 10, 460, new Color("#000000"), $font_bold, 0);
-                break;
-            }
-            if ($i == 0) {
-                $text = mb_substr($info['introduce'], $i * 17, 17);
-            } else {
-                $text = mb_substr($info['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);
-        }
-        $editor->open($image_icon, public_path() . '/base/poster/img/phone.png');
-        $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']],
-                    ['id',$userAuth->up_agent_id]
-                ])->first();
-                $name = $agent_check->realname;
-                $phone = $agent_check->phone;
-            }
-        } else {
-            $agent_check = AlbumAgentModel::where([
-                ['store_id',$data['store_id']],
-                ['user_id',$userAuth->id]
-            ])->first();
-            $name = $agent_check->realname;
-            $phone = $agent_check->phone;
-        }
-        $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);
+
+        $WeChatApp = AlbumManufacturerModel::where('store_id', $store_id)->first();
+
         if ($agent_id == 0) {
             $editor->open($image_qrcode, str_replace(env('CDN_URL'), public_path(), $info['qrcode']));
-            $editor->resizeExactWidth($image_qrcode, 140);
-            $editor->resizeExactHeight($image_qrcode, 140);
+            $editor->resizeExactWidth($image_qrcode, 430);
+            $editor->resizeExactHeight($image_qrcode, 430);
         } 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, '参数错误,请检查配置', []);
             }
             $editor->open($image_qrcode, $file);
-            $editor->resizeExactWidth($image_qrcode, 140);
-            $editor->resizeExactHeight($image_qrcode, 140);
+            $editor->resizeExactWidth($image_qrcode, 430);
+            $editor->resizeExactHeight($image_qrcode, 430);
         }
-
-        $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->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->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'));
     }

+ 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;
+    }
+
+}

+ 14 - 0
app/Repositories/Album/UserRepository.php

xqd
@@ -29,6 +29,20 @@ class UserRepository extends Repository {
             });
         }
 
+        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);
+            });
+        }
+
         // dd($orderby);
         $currentQuery = $currentQuery->where(function ($query) use ($search) {
             $query->where('store_id',$search['storeid']);

+ 1 - 1
database/migrations/2019_05_20_094445_add_column_banners_to_album_poster.php

xqd
@@ -15,7 +15,7 @@ class AddColumnBannersToAlbumPoster extends Migration
     {
         Schema::table('album_poster', function (Blueprint $table) {
             //
-            $table->longText('banner')->nullable()->default('[]')->comment('九张图');
+            $table->longText('banner')->nullable()->comment('九张图');
         });
     }
 

+ 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) {
+            //
+        });
+    }
+}

+ 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="">

+ 34 - 4
resources/views/admin/album/agent/index.blade.php

xqd xqd xqd xqd
@@ -33,7 +33,7 @@
 						</div>
 						@if(role('Album/Agent/batch'))
     					<div class="col-sm-3 pull-right">
-    					   <a href="{{ U('Album/Agent/batch')}}" class="btn btn-sm btn-primary pull-right" onclick="return confirm('你确定批量通过审核?');">批量审核</a>
+    					   <a class="btn btn-sm btn-primary pull-right" onclick="batch()">批量审核</a>
     					</div>
 						@endif
 					</div>
@@ -55,7 +55,7 @@
 						<tbody>
 						@if(isset($list))
 							@foreach($list as $key => $item)							<tr>
-								<td><input id="{{ $item->id }}" class="checkItem" name="checkItem" type="checkbox"></td>
+								<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>
@@ -120,15 +120,16 @@
 		</div>
 	</div>
 </div>
+<link href="/base/css/plugins/toastr/toastr.min.css" rel="stylesheet">
+<script src="/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 () {
@@ -139,7 +140,36 @@
                 $(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

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

xqd
@@ -0,0 +1,157 @@
+@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

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

xqd
@@ -37,7 +37,17 @@
 
 
 
+                                    <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">

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

xqd
@@ -0,0 +1,301 @@
+@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">电话</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(130像素 * 130像素)</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">&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

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

xqd
@@ -0,0 +1,87 @@
+@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="cat_id"> 标题 </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>
+            <td>{{ $item->title }}</td>
+								<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

+ 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]) }}'"