dyjh 6 anos atrás
pai
commit
41a7b00251
54 arquivos alterados com 3167 adições e 839 exclusões
  1. 2 0
      app/Http/Controllers/Admin/Album/AgentController.php
  2. 75 56
      app/Http/Controllers/Admin/Album/CatController.php
  3. 3 0
      app/Http/Controllers/Admin/Album/PosterController.php
  4. 8 2
      app/Http/Controllers/Admin/Album/Product/PriceController.php
  5. 92 58
      app/Http/Controllers/Admin/Album/ProductController.php
  6. 15 4
      app/Http/Controllers/Admin/Base/PhotosController.php
  7. 858 0
      app/Http/Controllers/Api/V1/AlbumBossController.php
  8. 264 202
      app/Http/Controllers/Api/V1/AlbumController.php
  9. 19 0
      app/Http/Controllers/Api/V1/AlbumPosterController.php
  10. 2 1
      app/Http/Controllers/Api/V1/Controller.php
  11. 4 0
      app/Models/AlbumAgentModel.php
  12. 0 1
      app/Models/AlbumCatModel.php
  13. 2 0
      app/Models/AlbumProductPriceModel.php
  14. 3 0
      app/Models/AlbumUserModel.php
  15. 1 1
      app/Models/CustomerCatRecordModel.php
  16. 13 12
      app/Repositories/Album/Criteria/CatWhere.php
  17. 6 3
      app/Repositories/Album/Criteria/MultiWhere.php
  18. 4 1
      app/Repositories/Album/Criteria/PriceWhere.php
  19. 9 9
      app/Repositories/Album/Criteria/ProductWhere.php
  20. 1 1
      app/Repositories/Album/UserRepository.php
  21. 3 2
      app/Services/Base/Attachment.php
  22. 2 0
      app/Services/Base/ErrorCode.php
  23. 35 0
      database/migrations/2019_04_14_105335_add_address_info_to_album_user.php
  24. 33 0
      database/migrations/2019_04_14_141741_add_is_new_to_album_watch_record.php
  25. 33 0
      database/migrations/2019_04_15_104944_add_store_id_to_base_attachment.php
  26. 34 0
      database/migrations/2019_04_16_183629_add_column_cat_id_to_album_product_price.php
  27. 35 0
      database/migrations/2019_04_16_201403_add_st_column_to_album_agent.php
  28. 33 0
      database/migrations/2019_04_17_092129_add_column_share_to_album_agent.php
  29. 33 0
      database/migrations/2019_04_17_110528_change_customer_cat_record.php
  30. 555 1
      public/apidoc/api_data.js
  31. 555 1
      public/apidoc/api_data.json
  32. 1 1
      public/apidoc/api_project.js
  33. 1 1
      public/apidoc/api_project.json
  34. 15 31
      resources/views/admin/album/agent/index.blade.php
  35. 8 22
      resources/views/admin/album/banner/index.blade.php
  36. 24 24
      resources/views/admin/album/cat/edit.blade.php
  37. 120 120
      resources/views/admin/album/cat/index.blade.php
  38. 1 8
      resources/views/admin/album/cat/view.blade.php
  39. 8 22
      resources/views/admin/album/comments/index.blade.php
  40. 5 17
      resources/views/admin/album/info/cat/index.blade.php
  41. 8 24
      resources/views/admin/album/information/index.blade.php
  42. 10 14
      resources/views/admin/album/manufacturer/index.blade.php
  43. 8 22
      resources/views/admin/album/nav/index.blade.php
  44. 8 22
      resources/views/admin/album/news/index.blade.php
  45. 8 25
      resources/views/admin/album/product/attr/index.blade.php
  46. 39 24
      resources/views/admin/album/product/edit.blade.php
  47. 8 22
      resources/views/admin/album/product/index.blade.php
  48. 80 11
      resources/views/admin/album/product/price/index.blade.php
  49. 9 4
      resources/views/admin/album/user/index.blade.php
  50. 2 2
      resources/views/admin/auth/login.blade.php
  51. 7 23
      resources/views/admin/furniture/goods/category/index.blade.php
  52. 7 22
      resources/views/admin/furniture/goods/index.blade.php
  53. 7 23
      resources/views/admin/furniture/newgoods/comment/index.blade.php
  54. 51 0
      routes/api.php

+ 2 - 0
app/Http/Controllers/Admin/Album/AgentController.php

xqd
@@ -51,6 +51,8 @@ class AgentController extends Controller
             }else{
                 $item->status = '已审核';
             }
+            $user = AlbumUserModel::where('id', $item->user_id)->first();
+            $item->nickname = $user->username;
         }
         return view('admin.album.agent.index',compact('list'));
     }

+ 75 - 56
app/Http/Controllers/Admin/Album/CatController.php

xqd xqd xqd xqd xqd xqd
@@ -20,39 +20,52 @@ class CatController extends Controller
 {
     private $repository;
 
-    public function __construct(CatRepository $repository) {
-        if(!$this->repository) $this->repository = $repository;
+    public function __construct(CatRepository $repository)
+    {
+        if (!$this->repository) {
+            $this->repository = $repository;
+        }
     }
 
-    function index(Request $request) {
-        //AlbumCatModel::where()->get();
+    /**
+     * @param Request $request
+     * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
+     */
+    function index(Request $request)
+    {
         $search['keyword'] = $request->input('keyword');
-        $query = $this->repository->pushCriteria(new CatWhere($search,0,$this->getStoreId()));
+        $query = $this->repository->pushCriteria(new CatWhere($search, 0, $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'));
+        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('sort', 'DESC'));
         }
         $list = $query->paginate();
         foreach ($list as $key => $item) {
             //dump($item);
-            $item->sonlist = AlbumCatModel::where([['parent_id',$item->id],['store_id',$this->getStoreId()]])->get();
+
+            $item->sonlist = AlbumCatModel::where([['parent_id',$item->id],['store_id',$this->getStoreId()]])->orderByDesc('sort')->get();
+
         }
 //        dump($list);
-        return view('admin.album.cat.index',compact('list'));
+        return view('admin.album.cat.index', compact('list'));
     }
 
-
-    function check(Request $request) {
+    /**
+     * @param Request $request
+     * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
+     */
+    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'])) {
+        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.cat.check',compact('list'));
+        $list = $this->repository->search($search, $orderby);
+        return view('admin.album.cat.check', compact('list'));
     }
 
 
@@ -62,12 +75,12 @@ class CatController extends Controller
      */
     public function create(Request $request)
     {
-        if($request->method() == 'POST') {
+        if ($request->method() == 'POST') {
             return $this->_createSave();
         }
-        $cat = AlbumCatModel::where('parent_id',0)->get();
+        $cat = AlbumCatModel::where([['parent_id', 0],['store_id',$this->getStoreId()]])->get();
         $data['parent_id'] = null;
-        return view('admin.album.cat.edit',compact('data','cat'));
+        return view('admin.album.cat.edit', compact('data', 'cat'));
     }
 
     /**
@@ -76,17 +89,18 @@ class CatController extends Controller
     private function _createSave(){
         $data = (array) request('data');
         $data['store_id'] = $this->getStoreId();
-        if(!empty($data['pic_url']))
-        $data['pic_url'] = $this->formatImgUrl($data['pic_url']);
+        if (!empty($data['pic_url'])) {
+            $data['pic_url'] = $this->formatImgUrl($data['pic_url']);
+        }
 
         $id = $this->repository->create($data);
-        if($id) {
-            $url[] = array('url'=>U( 'Album/Cat/index'),'title'=>'返回列表');
-            $url[] = array('url'=>U( 'Album/Cat/create'),'title'=>'继续添加');
-            $this->showMessage('添加成功',$url);
-        }else{
-            $url[] = array('url'=>U( 'Album/Cat/index'),'title'=>'返回列表');
-            return $this->showWarning('添加失败',$url);
+        if ($id) {
+            $url[] = array('url' => U('Album/Cat/index'), 'title' => '返回列表');
+            $url[] = array('url' => U('Album/Cat/create'), 'title' => '继续添加');
+            $this->showMessage('添加成功', $url);
+        } else {
+            $url[] = array('url' => U('Album/Cat/index'), 'title' => '返回列表');
+            return $this->showWarning('添加失败', $url);
         }
     }
     
@@ -96,36 +110,41 @@ class CatController extends Controller
      * 
      * 
      */
-    public function update(Request $request) {
-        if($request->method() == 'POST') {
+    public function update(Request $request)
+    {
+        if ($request->method() == 'POST') {
             return $this->_updateSave();
         }
         $data = $this->repository->find($request->get('id'));
-        $cat = AlbumCatModel::where('parent_id',0)->get();
+        $cat = AlbumCatModel::where([['parent_id',0],['store_id',$this->getStoreId()]])->get();
 
-        return view('admin.album.cat.edit',compact('data','cat'));
+        return view('admin.album.cat.edit', compact('data', 'cat'));
     }
 
     /**
      * 保存修改
      */
-    private function _updateSave() {
+    private function _updateSave()
+    {
         $data = (array) request('data');
-        if(!empty($data['pic_url']))
-        $data['pic_url'] = $this->formatImgUrl($data['pic_url']);
-        $ok = $this->repository->update(request('id'),$data);
-        if($ok) {
-            $url[] = array('url'=>U( 'Album/Cat/index'),'title'=>'返回列表');
-            return $this->showMessage('操作成功',urldecode(request('_referer')));
-        }else{
-            $url[] = array('url'=>U( 'Album/Cat/index'),'title'=>'返回列表');
-            return $this->showWarning('操作失败',$url);
+        if (!empty($data['pic_url'])) {
+            $data['pic_url'] = $this->formatImgUrl($data['pic_url']);
+        }
+
+        $ok = $this->repository->update(request('id'), $data);
+        if ($ok) {
+            $url[] = array('url' => U('Album/Cat/index'), 'title' => '返回列表');
+            return $this->showMessage('操作成功', urldecode(request('_referer')));
+        } else {
+            $url[] = array('url' => U('Album/Cat/index'), 'title' => '返回列表');
+            return $this->showWarning('操作失败', $url);
         }
     }
 
-    public function view(Request $request) {
+    public function view(Request $request)
+    {
         $data = $this->repository->find(request('id'));
-        return view('admin.album.cat.view',compact('data'));
+        return view('admin.album.cat.view', compact('data'));
     }
 
 
@@ -134,12 +153,12 @@ class CatController extends Controller
      * 状态改变
      *
      */
-    public function status(Request $request) {
-
-        $ok = $this->repository->updateStatus(request('id'),request('status'));
-        if($ok) {
+    public function status(Request $request)
+    {
+        $ok = $this->repository->updateStatus(request('id'), request('status'));
+        if ($ok) {
             return $this->showMessage('操作成功');
-        }else{
+        } else {
             return $this->showWarning('操作失败');
         }
     }
@@ -147,17 +166,17 @@ class CatController extends Controller
     /**
      * 删除
      */
-    public function destroy(Request $request) {
-        //$bool = $this->repository->destroy($request->get('id'));
+    public function destroy(Request $request)
+    {
         $cat = AlbumCatModel::find($request->get('id'));
-        $son_cat = AlbumCatModel::where('parent_id',$cat->id)->delete();
-        if($son_cat){
-            //$son_cat->delete();
+        $son_cat = AlbumCatModel::where('parent_id', $cat->id)->delete();
+        if ($son_cat) {
+            $son_cat->delete();
         }
         $ok = $cat->delete();
-        if($ok) {
+        if ($ok) {
             return  $this->showMessage('操作成功');
-        }else{
+        } else {
             return  $this->showWarning("操作失败");
         }
     }

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

xqd
@@ -53,6 +53,9 @@ class PosterController extends Controller
             }
             $data['posters'] = json_encode($data['posters']['url']);
         }
+        if (empty($data['share']) || empty($data['qrcode'])) {
+            return $this->showMessage('分享海报或者二维码不能为空!');
+        }
         $data['share'] = $this->formatImgUrl($data['share']);
         $data['qrcode'] = $this->formatImgUrl($data['qrcode']);
         if (!empty($data['words'])) {

+ 8 - 2
app/Http/Controllers/Admin/Album/Product/PriceController.php

xqd xqd xqd
@@ -8,6 +8,7 @@
  */
 namespace App\Http\Controllers\Admin\Album\Product;
 use App\Http\Controllers\Admin\Controller;
+use App\Models\AlbumCatModel;
 use App\Models\AlbumProductModel;
 use App\Models\AlbumProductPriceModel;
 use App\Repositories\Album\Criteria\PriceWhere;
@@ -28,7 +29,8 @@ class PriceController extends Controller
         $agent_id = $request->input('id');
         //dd($agent_id);die;
         $search['keyword'] = $request->input('keyword');
-        $query = $this->repository->pushCriteria(new PriceWhere($search,$this->getStoreId(),$agent_id));
+        $search['cat_id'] = $request->input('cat_id');
+        $query = $this->repository->pushCriteria(new PriceWhere($search, $this->getStoreId(), $agent_id));
 
         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']));
@@ -39,9 +41,13 @@ class PriceController extends Controller
         foreach ($list as $item){
             $product = AlbumProductModel::where([['id',$item->product_id],['store_id',$this->getStoreId()]])->first();
             $item->product_name = $product['name'];
+            $cat = AlbumCatModel::where('id', $product['cat_id'])->first();
+            $item->product_cat = $cat->name;
+            $item->product_ma_price_comment = $product['ma_price_comment'];
             $item->product_pic = $product['cover_pic'];
         }
-        return view('admin.album.product.price.index',compact('list'));
+        $cat = AlbumCatModel::where([['store_id',$this->getStoreId()],['parent_id',0]])->get();
+        return view('admin.album.product.price.index',compact('list', 'cat'));
     }
 
 

+ 92 - 58
app/Http/Controllers/Admin/Album/ProductController.php

xqd xqd xqd xqd xqd xqd xqd xqd
@@ -10,6 +10,7 @@ namespace App\Http\Controllers\Admin\Album;
 use App\Http\Controllers\Admin\Controller;
 use App\Models\AlbumCatModel;
 use App\Models\AlbumProductModel;
+use App\Models\AlbumProductPriceModel;
 use App\Models\AlbumProductStyleModel;
 use App\Repositories\Album\Criteria\ProductWhere;
 use Illuminate\Http\Request;
@@ -21,25 +22,36 @@ class ProductController extends Controller
 {
     private $repository;
 
-    public function __construct(ProductRepository $repository) {
-        if(!$this->repository) $this->repository = $repository;
+    /**
+     * ProductController constructor.
+     * @param ProductRepository $repository
+     */
+    public function __construct(ProductRepository $repository)
+    {
+        if (!$this->repository) {
+            $this->repository = $repository;
+        }
     }
 
-    function index(Request $request) {
+    function index(Request $request)
+    {
         $search['keyword'] = $request->input('keyword');
-        $query = $this->repository->pushCriteria(new ProductWhere($search,$this->getStoreId()));
+        $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'));
+        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();
-            $style = AlbumProductStyleModel::where('id',$item->style)->first();
-            $item->cat_name = $cat['name'];
-            $item->style_name = $style['name'];
+            $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);
@@ -48,7 +60,7 @@ class ProductController extends Controller
             $list[$key]['detail'] = $detail[0];
         }
         //dd($list);
-        return view('admin.album.product.index',compact('list'));
+        return view('admin.album.product.index', compact('list'));
     }
 
     /**
@@ -86,7 +98,7 @@ class ProductController extends Controller
                 'id'   => 0
             ];
         }
-        // print_r($cat);die;
+
         return response()->json([
             'data' => $cat,
             'code' => 0
@@ -111,41 +123,48 @@ class ProductController extends Controller
     /**
      * 保存修改
      */
-    private function _createSave(){
+    private function _createSave()
+    {
         $data = (array) request('data');
         $data['store_id'] = $this->getStoreId();
-        if(!empty($data['specifications_img']['url'])) {
-            foreach ($data['specifications_img']['url'] as $key=>$val) {
+        if (!empty($data['specifications_img']['url'])) {
+            foreach ($data['specifications_img']['url'] as $key => $val) {
                 $data['specifications_img']['url'][$key] = $this->formatImgUrl($val);
             }
             $data['specifications_img'] = json_encode($data['specifications_img']['url']);
         }
-        if(!empty($data['install_img']['url'])){
-            foreach ($data['install_img']['url'] as $key=>$val) {
+        if (!empty($data['install_img']['url'])) {
+            foreach ($data['install_img']['url'] as $key => $val) {
                 $data['install_img']['url'][$key] = $this->formatImgUrl($val);
             }
             $data['install_img'] = json_encode($data['install_img']['url']);
         }
-        if(!empty($data['cover_pic']))
+        if (!empty($data['cover_pic'])) {
             $data['cover_pic'] = $this->formatImgUrl($data['cover_pic']);
-        if(!empty($data['thumb']))
+        }
+
+        if (!empty($data['thumb'])) {
             $data['thumb'] = $this->formatImgUrl($data['thumb']);
-        if(!empty($data['detail']['url'])) {
-            foreach ($data['detail']['url'] as $key=>$val) {
+        }
+
+        if (!empty($data['detail']['url'])) {
+            foreach ($data['detail']['url'] as $key => $val) {
                 $data['detail']['url'][$key] = $this->formatImgUrl($val);
             }
             $data['detail'] = json_encode($data['detail']['url']);
         }
-        if(!empty($data['detail_pic']))
+        if (!empty($data['detail_pic'])) {
             $data['detail_pic'] = $this->formatImgUrl($data['detail_pic']);
+        }
+
         $id = $this->repository->create($data);
-        if($id) {
-            $url[] = array('url'=>U( 'Album/Product/index'),'title'=>'返回列表');
-            $url[] = array('url'=>U( 'Album/Product/create'),'title'=>'继续添加');
-            $this->showMessage('添加成功',$url);
-        }else{
-            $url[] = array('url'=>U( 'Album/Product/index'),'title'=>'返回列表');
-            return $this->showWarning('添加失败',$url);
+        if ($id) {
+            $url[] = array('url' => U('Album/Product/index'), 'title' => '返回列表');
+            $url[] = array('url' => U('Album/Product/create'), 'title' => '继续添加');
+            $this->showMessage('添加成功', $url);
+        } else {
+            $url[] = array('url' => U('Album/Product/index'), 'title' => '返回列表');
+            return $this->showWarning('添加失败', $url);
         }
     }
 
@@ -172,46 +191,59 @@ class ProductController extends Controller
     /**
      * 保存修改
      */
-    private function _updateSave() {
+    private function _updateSave()
+    {
         $data = (array) request('data');
-        if(!empty($data['specifications_img']['url'])) {
-            foreach ($data['specifications_img']['url'] as $key=>$val) {
+        if (!empty($data['specifications_img']['url'])) {
+            foreach ($data['specifications_img']['url'] as $key => $val) {
                 $data['specifications_img']['url'][$key] = $this->formatImgUrl($val);
             }
             $data['specifications_img'] = json_encode($data['specifications_img']['url']);
         }
-        if(!empty($data['install_img']['url'])){
-            foreach ($data['install_img']['url'] as $key=>$val) {
+        if (!empty($data['install_img']['url'])) {
+            foreach ($data['install_img']['url'] as $key => $val) {
                 $data['install_img']['url'][$key] = $this->formatImgUrl($val);
             }
             $data['install_img'] = json_encode($data['install_img']['url']);
         }
-        if(!empty($data['cover_pic']))
+        if (!empty($data['cover_pic'])) {
             $data['cover_pic'] = $this->formatImgUrl($data['cover_pic']);
-        if(!empty($data['thumb']))
+        }
+        if (!empty($data['thumb'])) {
             $data['thumb'] = $this->formatImgUrl($data['thumb']);
-        if(!empty($data['detail']['url'])) {
-            foreach ($data['detail']['url'] as $key=>$val) {
+        }
+
+        if (!empty($data['detail']['url'])) {
+            foreach ($data['detail']['url'] as $key => $val) {
                 $data['detail']['url'][$key] = $this->formatImgUrl($val);
             }
             $data['detail'] = json_encode($data['detail']['url']);
         }
-        if(!empty($data['detail_pic']))
+        if (!empty($data['detail_pic'])) {
             $data['detail_pic'] = $this->formatImgUrl($data['detail_pic']);
-        // dd($data);
-        $ok = $this->repository->update(request('id'),$data);
-        if($ok) {
-            $url[] = array('url'=>U( 'Album/Product/index'),'title'=>'返回列表');
-            return $this->showMessage('操作成功',urldecode(request('_referer')));
-        }else{
-            $url[] = array('url'=>U( 'Album/Product/index'),'title'=>'返回列表');
-            return $this->showWarning('操作失败',$url);
+
+        }
+
+        $price = AlbumProductPriceModel::where('product_id', request('id'))->get();
+        foreach ($price as $p) {
+            $p->cat_id = $data['cat_id'];
+            $p->name = $data['name'];
+        }
+        $ok = $this->repository->update(request('id'), $data);
+        if ($ok) {
+            $url[] = array('url' => U('Album/Product/index'), 'title' => '返回列表');
+            return $this->showMessage('操作成功', urldecode(request('_referer')));
+        } else {
+            $url[] = array('url' => U('Album/Product/index'), 'title' => '返回列表');
+            return $this->showWarning('操作失败', $url);
+
         }
     }
 
-    public function view(Request $request) {
+    public function view(Request $request)
+    {
         $data = $this->repository->find(request('id'));
-        return view('admin.album.product.view',compact('data'));
+        return view('admin.album.product.view', compact('data'));
     }
 
 
@@ -220,11 +252,12 @@ class ProductController extends Controller
      * 状态改变
      *
      */
-    public function status(Request $request) {
-        $ok = $this->repository->updateStatus(request('id'),request('status'));
-        if($ok) {
+    public function status(Request $request)
+    {
+        $ok = $this->repository->updateStatus(request('id'), request('status'));
+        if ($ok) {
             return $this->showMessage('操作成功');
-        }else{
+        } else {
             return $this->showWarning('操作失败');
         }
     }
@@ -232,13 +265,14 @@ class ProductController extends Controller
     /**
      * 删除
      */
-    public function destroy(Request $request) {
+    public function destroy(Request $request)
+    {
         //$bool = $this->repository->destroy($request->get('id'));
         $cat = AlbumProductModel::find($request->get('id'));
         $ok = $cat->delete();
-        if($ok) {
+        if ($ok) {
             return  $this->showMessage('操作成功');
-        }else{
+        } else {
             return  $this->showWarning("操作失败");
         }
     }

+ 15 - 4
app/Http/Controllers/Admin/Base/PhotosController.php

xqd xqd xqd
@@ -11,6 +11,7 @@ use Illuminate\Http\Request as HttpRequest;
 use Request;
 use Storage;
 use File;
+use Auth;
 
 class PhotosController extends Controller
 {
@@ -23,6 +24,7 @@ class PhotosController extends Controller
 
     public function index(HttpRequest $request)
     {
+        $userAuth = Auth::guard('admin')->user();
         $classes = ClassModel::all();
         $a_class = $request->has('class') ? $request->input('class') : null;
         if(($a_class = ClassModel::find($a_class)) == null) {
@@ -30,13 +32,22 @@ class PhotosController extends Controller
         }
         $photos = null;
         $status = 'normal';
-        if($request->has('search')) {
+        if ($request->has('search')) {
             $name = '%' . $request->input('search') . '%';
-            $photos = BaseAttachmentModel::where('name', 'like', $name)->paginate(24);
+            if ($userAuth->is_root == 1) {
+                $photos = BaseAttachmentModel::where([['name', 'like', $name]])->paginate(24);
+            } else {
+                $photos = BaseAttachmentModel::where([['name', 'like', $name],['store_id', $this->getStoreId()]])->paginate(24);
+            }
+
             $status = 'search';
         } else {
-            if($a_class){
-                $photos = BaseAttachmentModel::where('class', $a_class->class)->paginate(24);
+            if ($a_class) {
+                if ($userAuth->is_root == 1) {
+                    $photos = BaseAttachmentModel::where([['class', $a_class->class]])->paginate(24);
+                } else {
+                    $photos = BaseAttachmentModel::where([['class', $a_class->class],['store_id', $this->getStoreId()]])->paginate(24);
+                }
             }
         }
 

+ 858 - 0
app/Http/Controllers/Api/V1/AlbumBossController.php

xqd
@@ -0,0 +1,858 @@
+<?php
+/**
+ * Created by PhpStorm.
+ * User: 思维定制
+ * Date: 2019/4/11
+ * Time: 17:41
+ */
+
+namespace App\Http\Controllers\Api\V1;
+
+use App\Models\AlbumAgentModel;
+use App\Models\AlbumCatModel;
+use App\Models\AlbumProductModel;
+use App\Models\AlbumUserModel;
+use App\Models\AlbumWatchRecord;
+use App\Models\CustomerCatRecordModel;
+use App\Models\CustomerDetailsModel;
+use Illuminate\Http\Request;
+use Validator, Response,Auth;
+use App\Services\Base\ErrorCode;
+
+class AlbumBossController extends Controller
+{
+    /**
+     * @api {get} /api/album_boss/get_top 经销商排行榜(get_top)
+     * @apiDescription 经销商排行榜(get_top)
+     * @apiGroup Boss
+     * @apiPermission none
+     * @apiVersion 0.1.0
+     * @apiParam {int}    [store_id]  商户id
+     * @apiSuccessExample {json} Success-Response:
+     * HTTP/1.1 200 OK
+     * {
+     *     "status": true,
+     *     "status_code": 0,
+     *     "message": "",
+     *     "data": {
+     *         "agent": [
+     *              {
+     *                  "id": 3,
+     *                  "avatar": "http://admin.xcx.com/upload/images/20180519/02f2dbe0e1046d7cea8b3b52d5642fb8.jpg",
+     *                  "name": "张三",
+     *                  "get_count": "客户数量",
+     *              }
+     *          ],
+     *     }
+     * }
+     * @apiErrorExample {json} Error-Response:
+     * HTTP/1.1 400 Bad Request
+     * {
+     *     "state": false,
+     *     "code": 1000,
+     *     "message": "传入参数不正确",
+     *     "data": null or []
+     * }
+     * 可能出现的错误代码:
+     *    1000    CLIENT_WRONG_PARAMS             传入参数不正确
+     */
+    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'
+        ], [
+            'store_id.required' => '缺少商户参数',
+        ]);
+
+        if ($userAuth->role != 4) {
+            return $this->error(ErrorCode::NOT_BOSS, '该用户没有Boss权限');
+        }
+
+        if ($validator->fails()) {
+            return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '传入参数不正确!', $validator->messages());
+        }
+        $store_id = $request->input('store_id');
+        $agentData = AlbumAgentModel::where('store_id', $store_id)->orderByDesc('get_count')->paginate(20);
+        foreach ($agentData as $value) {
+            $user = AlbumUserModel::where([['id', $value->user_id], ['store_id', $store_id]])->first(['avatar']);
+            $value->avatar = $user->avatar;
+        }
+
+        return $this->api($agentData, 0, 'success');
+    }
+
+    /**
+     * @api {post} /api/album_boss/agent_customer 经销商客户(agent_customer)
+     * @apiDescription 经销商客户(agent_customer)
+     * @apiGroup Boss
+     * @apiPermission none
+     * @apiVersion 0.1.0
+     * @apiParam {int}    [store_id]  商户id
+     * @apiParam {int}    [agent_id]  经销商id
+     * @apiParam {int}    [pageNum]   分页
+     * @apiSuccessExample {json} Success-Response:
+     * HTTP/1.1 200 OK
+     * {
+     *     "status": true,
+     *     "status_code": 0,
+     *     "message": "",
+     *     "data": {
+     *         "agent": [
+     *              {
+     *                  "id": 3,
+     *                  "avatar": "http://admin.xcx.com/upload/images/20180519/02f2dbe0e1046d7cea8b3b52d5642fb8.jpg",
+     *                  "name": "张三",
+     *                  "address": "四川省",
+     *                  "phone": "8208208820",
+     *                  "lon": "100.123123",
+     *                  "lat": "123.123123",
+     *              }
+     *          ],
+     *         "customer": [
+     *              {
+     *                  "id": 3,
+     *                  "avatar": "http://admin.xcx.com/upload/images/20180519/02f2dbe0e1046d7cea8b3b52d5642fb8.jpg",
+     *                  "name": "张三",
+     *                  "address": "四川省甘肃市"
+     *               }
+     *          ]
+     *     }
+     * }
+     * @apiErrorExample {json} Error-Response:
+     * HTTP/1.1 400 Bad Request
+     * {
+     *     "state": false,
+     *     "code": 1000,
+     *     "message": "传入参数不正确",
+     *     "data": null or []
+     * }
+     * 可能出现的错误代码:
+     *    1000    CLIENT_WRONG_PARAMS             传入参数不正确
+     */
+    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',
+            'pageNum' => 'required',
+        ], [
+            'store_id.required' => '缺少商户参数',
+            'agent_id.required' => '缺少经销商参数',
+            'pageNum.required' => '缺少页码参数',
+        ]);
+
+        if ($userAuth->role != 4) {
+            return $this->error(ErrorCode::NOT_BOSS, '该用户没有Boss权限');
+        }
+
+        if ($validator->fails()) {
+            return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '传入参数不正确!', $validator->messages());
+        }
+
+        $data = $request->input();
+        $agent = AlbumAgentModel::where([['store_id', $data['store_id']], ['id', $data['agent_id']]])->first();
+        $userCount = AlbumWatchRecord::where([
+            ['agent_id', $agent->id], ['store_id',$data['store_id']]
+        ])->groupBy('open_id')->get();
+        $i = 0;
+        foreach ($userCount as $value) {
+            if ($i >= (($data['pageNum'] - 1) * 20) && $i < ($data['pageNum'] * 20)) {
+                $user = AlbumUserModel::where('open_id', $value->open_id)->first(['avatar', 'username', 'address']);
+                $userComment = CustomerDetailsModel::where('open_id', $value->open_id)->first(['comment']);
+                if (!$userComment) {
+                    $customer[] = [
+                        'name' => '暂无',
+                        'avatar' => $user->avatar,
+                        'username' => $user->username,
+                        'address' => $user->address
+                    ];
+                } else {
+                    $customer[] = [
+                        'name' => $userComment->comment,
+                        'avatar' => $user->avatar,
+                        'username' => $user->username,
+                        'address' => $user->address
+                    ];
+                }
+            }
+            $i++;
+        }
+
+        return $this->api(compact('agent', 'customer'), 0, 'success');
+    }
+
+
+
+    /**
+     * @api {post} /api/album_boss/agent_statistical 经销商数据(agent_statistical)
+     * @apiDescription 经销商数据(agent_statistical)
+     * @apiGroup Boss
+     * @apiPermission none
+     * @apiVersion 0.1.0
+     * @apiParam {int}    [store_id]  商户id
+     * @apiParam {int}    [agent_id]  经销商id
+     * @apiParam {int}    [start]     开始时间
+     * @apiParam {int}    [end]       结束时间
+     * @apiSuccessExample {json} Success-Response:
+     * HTTP/1.1 200 OK
+     * {
+     *     "status": true,
+     *     "status_code": 0,
+     *     "message": "",
+     *     "data": {
+     *         "favoriteCount":11,
+     *         "downloadCount":11,
+     *         "shareCount":11,
+     *         "newCustomerCount":11,
+     *         "totalCustomerCount":11,
+     *     }
+     * }
+     * @apiErrorExample {json} Error-Response:
+     * HTTP/1.1 400 Bad Request
+     * {
+     *     "state": false,
+     *     "code": 1000,
+     *     "message": "传入参数不正确",
+     *     "data": null or []
+     * }
+     * 可能出现的错误代码:
+     *    1000    CLIENT_WRONG_PARAMS             传入参数不正确
+     */
+    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',
+        ], [
+            'store_id.required' => '缺少商户参数',
+            'agent_id.required' => '缺少经销商参数',
+        ]);
+
+        if ($userAuth->role != 4) {
+            return $this->error(ErrorCode::NOT_BOSS, '该用户没有Boss权限');
+        }
+
+        if ($validator->fails()) {
+            return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '传入参数不正确!', $validator->messages());
+        }
+
+        $data = $request->input();
+        $end = $request->input('end');
+        $start = $request->input('start');
+        if (!$end) {
+            $end = time();
+        }
+        if (!$start) {
+            $start = 0;
+        }
+        $end = date('Y-m-d H:i:s', $end);
+        $start = date('Y-m-d H:i:s', $start);
+        $favoriteCount = AlbumWatchRecord::where([
+            ['agent_id', $data['agent_id']],
+            ['store_id', $data['store_id']],
+            ['action', 1],
+            ['updated_at','>=',$start],
+            ['updated_at','<=',$end]
+        ])->orderByDesc('id')->count();
+
+        $downloadCount = AlbumWatchRecord::where([
+            ['agent_id', $data['agent_id']],
+            ['store_id', $data['store_id']],
+            ['action', 9],
+            ['updated_at','>=',$start],
+            ['updated_at','<=',$end]
+        ])->orderByDesc('id')->count();
+
+        $shareCount = AlbumWatchRecord::where([
+            ['agent_id', $data['agent_id']],
+            ['store_id', $data['store_id']],
+            ['action', 8],
+            ['updated_at','>=',$start],
+            ['updated_at','<=',$end]
+        ])->orderByDesc('id')->count();
+
+        $newCustomerCount = AlbumWatchRecord::where([
+            ['agent_id', $data['agent_id']],
+            ['store_id', $data['store_id']],
+            ['is_new', 1],
+            ['updated_at','>=',$start],
+            ['updated_at','<=',$end]
+        ])->orderByDesc('id')->count();
+
+        $totalCustomerCount = AlbumWatchRecord::where([
+            ['agent_id', $data['agent_id']],
+            ['store_id', $data['store_id']],
+            ['updated_at','>=',$start],
+            ['updated_at','<=',$end]
+        ])->orderByDesc('id')->groupBy('open_id')->count();
+
+        return $this->api(compact('shareCount', 'totalCustomerCount', 'newCustomerCount', 'downloadCount', 'favoriteCount'));
+    }
+
+    /**
+     * @api {post} /api/album_boss/agent_overview_active 经销商总览活跃客户(agent_overview_active)
+     * @apiDescription 经销商总览活跃客户(agent_overview_active)
+     * @apiGroup Boss
+     * @apiPermission none
+     * @apiVersion 0.1.0
+     * @apiParam {int}    [store_id]  商户id
+     * @apiSuccessExample {json} Success-Response:
+     * HTTP/1.1 200 OK
+     * {
+     *     "status": true,
+     *     "status_code": 0,
+     *     "message": "",
+     *     "data": {
+     *         "activeCustomers": [
+     *              {
+     *                  "day" : 03/25,
+     *                  "num" : 111
+     *              }
+     *          ],
+     *     }
+     * }
+     * @apiErrorExample {json} Error-Response:
+     * HTTP/1.1 400 Bad Request
+     * {
+     *     "state": false,
+     *     "code": 1000,
+     *     "message": "传入参数不正确",
+     *     "data": null or []
+     * }
+     * 可能出现的错误代码:
+     *    1000    CLIENT_WRONG_PARAMS             传入参数不正确
+     */
+    public function albumOverviewActive(Request $request)
+    {
+
+        $userAuth = Auth('api')->user();
+        if (!$userAuth) {
+            return $this->error(ErrorCode::ERROR_POWER, '登陆过期!');
+        }
+        $validator = Validator::make($request->all(), [
+            'store_id' => 'required',
+        ], [
+            'store_id.required' => '缺少商户参数',
+        ]);
+
+        if ($userAuth->role != 4) {
+            return $this->error(ErrorCode::NOT_BOSS, '该用户没有Boss权限');
+        }
+
+        if ($validator->fails()) {
+            return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '传入参数不正确!', $validator->messages());
+        }
+
+        $store_id = $request->input('store_id');
+
+        $activeCustomers = array();
+        for ($d = 0; $d < 15; $d++) {
+            $StartO = mktime(0, 0, 0, date('m'), date('d'), date('y')) - 86400 * $d;
+            $EndO = $StartO + 86400;
+            $End = date('Y-m-d H:i:s', $EndO);
+            $Start = date('Y-m-d H:i:s', $StartO);
+            $customerNum = AlbumWatchRecord::where([
+                ['store_id', $store_id],
+                ['updated_at','>=',$Start],
+                ['updated_at','<=',$End]
+            ])->orderByDesc('id')->groupBy('open_id')->count();
+            $activeCustomers[] = [
+                'day' => date('m', $StartO) . '-' . date('d', $EndO),
+                'num' => $customerNum
+            ];
+        }
+        return $this->api($activeCustomers);
+    }
+
+
+    /**
+     * @api {post} /api/album_boss/agent_overview_left 经销商总览左侧(agent_overview_left)
+     * @apiDescription 经销商总览左侧(agent_overview_left)
+     * @apiGroup Boss
+     * @apiPermission none
+     * @apiVersion 0.1.0
+     * @apiParam {int}    [store_id]  商户id
+     * @apiParam {int}    [start]     开始时间
+     * @apiParam {int}    [end]       结束时间
+     * @apiSuccessExample {json} Success-Response:
+     * HTTP/1.1 200 OK
+     * {
+     *     "status": true,
+     *     "status_code": 0,
+     *     "message": "",
+     *     "data": {
+     *         "customerFollow":11,
+     *         "downloadCount":11,
+     *         "shareCount":11,
+     *         "newCustomerCount":11,
+     *         "totalCustomerCount":11,
+     *     }
+     * }
+     * @apiErrorExample {json} Error-Response:
+     * HTTP/1.1 400 Bad Request
+     * {
+     *     "state": false,
+     *     "code": 1000,
+     *     "message": "传入参数不正确",
+     *     "data": null or []
+     * }
+     * 可能出现的错误代码:
+     *    1000    CLIENT_WRONG_PARAMS             传入参数不正确
+     */
+    public function albumOverviewLeft(Request $request)
+    {
+
+        $userAuth = Auth('api')->user();
+        if (!$userAuth) {
+            return $this->error(ErrorCode::ERROR_POWER, '登陆过期!');
+        }
+        $validator = Validator::make($request->all(), [
+            'store_id' => 'required',
+        ], [
+            'store_id.required' => '缺少商户参数',
+        ]);
+
+        if ($userAuth->role != 4) {
+            return $this->error(ErrorCode::NOT_BOSS, '该用户没有Boss权限');
+        }
+
+        if ($validator->fails()) {
+            return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '传入参数不正确!', $validator->messages());
+        }
+
+        $end = $request->input('end');
+        $start = $request->input('start');
+        $store_id = $request->input('store_id');
+        if (!$end) {
+            $end = time();
+        }
+        if (!$start) {
+            $start = 0;
+        }
+        $end = date('Y-m-d H:i:s', $end);
+        $start = date('Y-m-d H:i:s', $start);
+
+        $customerFollow = CustomerDetailsModel::where([
+            ['store_id', $store_id],
+            ['updated_at','>=',$start],
+            ['updated_at','<=',$end]
+            ])->count();
+        $downloadCount = AlbumWatchRecord::where([
+            ['store_id', $store_id],
+            ['action', 9],
+            ['updated_at','>=',$start],
+            ['updated_at','<=',$end]
+        ])->orderByDesc('id')->count();
+
+        $shareCount = AlbumWatchRecord::where([
+            ['store_id', $store_id],
+            ['action', 8],
+            ['updated_at','>=',$start],
+            ['updated_at','<=',$end]
+        ])->orderByDesc('id')->count();
+
+        $newCustomerCount = AlbumWatchRecord::where([
+            ['store_id', $store_id],
+            ['is_new', 1],
+            ['updated_at','>=',$start],
+            ['updated_at','<=',$end]
+        ])->orderByDesc('id')->count();
+
+        $totalCustomerCount = AlbumWatchRecord::where([
+            ['store_id', $store_id],
+            ['updated_at','>=',$start],
+            ['updated_at','<=',$end]
+        ])->orderByDesc('id')->groupBy('open_id')->count();
+        return $this->api(compact('totalCustomerCount', 'newCustomerCount', 'shareCount', 'downloadCount', 'customerFollow'));
+    }
+
+    /**
+     * @api {post} /api/album_boss/agent_overview_funnel 经销商总览漏斗(agent_overview_funnel)
+     * @apiDescription 经销商总览漏斗(agent_overview_funnel)
+     * @apiGroup Boss
+     * @apiPermission none
+     * @apiVersion 0.1.0
+     * @apiParam {int}    [store_id]  商户id
+     * @apiSuccessExample {json} Success-Response:
+     * HTTP/1.1 200 OK
+     * {
+     *     "status": true,
+     *     "status_code": 0,
+     *     "message": "",
+     *     "data": {
+     *         "customerFollow":11,
+     *         "shareCount":11,
+     *         "totalCustomerCount":11,
+     *     }
+     * }
+     * @apiErrorExample {json} Error-Response:
+     * HTTP/1.1 400 Bad Request
+     * {
+     *     "state": false,
+     *     "code": 1000,
+     *     "message": "传入参数不正确",
+     *     "data": null or []
+     * }
+     * 可能出现的错误代码:
+     *    1000    CLIENT_WRONG_PARAMS             传入参数不正确
+     */
+    public function albumOverviewFunnel(Request $request)
+    {
+
+        $userAuth = Auth('api')->user();
+        if (!$userAuth) {
+            return $this->error(ErrorCode::ERROR_POWER, '登陆过期!');
+        }
+        $validator = Validator::make($request->all(), [
+            'store_id' => 'required',
+        ], [
+            'store_id.required' => '缺少商户参数',
+        ]);
+
+        if ($userAuth->role != 4) {
+            return $this->error(ErrorCode::NOT_BOSS, '该用户没有Boss权限');
+        }
+
+        if ($validator->fails()) {
+            return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '传入参数不正确!', $validator->messages());
+        }
+
+        $store_id = $request->input('store_id');
+
+        $customerFollow = CustomerDetailsModel::where('store_id', $store_id)->count();
+        $shareCount = AlbumWatchRecord::where([
+            ['store_id', $store_id],
+            ['action', 8],
+        ])->orderByDesc('id')->count();
+
+        $totalCustomerCount = AlbumWatchRecord::where([
+            ['store_id', $store_id],
+        ])->orderByDesc('id')->groupBy('open_id')->count();
+        return $this->api(compact('totalCustomerCount', 'shareCount', 'customerFollow'));
+    }
+
+    /**
+     * @api {post} /api/album_boss/agent_overview_call 经销商总览咨询(agent_overview_call)
+     * @apiDescription 经销商总览咨询(agent_overview_call)
+     * @apiGroup Boss
+     * @apiPermission none
+     * @apiVersion 0.1.0
+     * @apiParam {int}    [store_id]  商户id
+     * @apiParam {int}    [day]     天数
+     * @apiSuccessExample {json} Success-Response:
+     * HTTP/1.1 200 OK
+     * {
+     *     "status": true,
+     *     "status_code": 0,
+     *     "message": "",
+     *     "data": {
+     *          "callCustomers": [
+     *              {
+     *                  "day" : 03/25,
+     *                  "num" : 111
+     *              }
+     *          ]
+     *     }
+     * }
+     * @apiErrorExample {json} Error-Response:
+     * HTTP/1.1 400 Bad Request
+     * {
+     *     "state": false,
+     *     "code": 1000,
+     *     "message": "传入参数不正确",
+     *     "data": null or []
+     * }
+     * 可能出现的错误代码:
+     *    1000    CLIENT_WRONG_PARAMS             传入参数不正确
+     */
+    public function albumOverviewCall(Request $request)
+    {
+
+        $userAuth = Auth('api')->user();
+        if (!$userAuth) {
+            return $this->error(ErrorCode::ERROR_POWER, '登陆过期!');
+        }
+        $validator = Validator::make($request->all(), [
+            'store_id' => 'required',
+        ], [
+            'store_id.required' => '缺少商户参数',
+        ]);
+
+        if ($userAuth->role != 4) {
+            return $this->error(ErrorCode::NOT_BOSS, '该用户没有Boss权限');
+        }
+
+        if ($validator->fails()) {
+            return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '传入参数不正确!', $validator->messages());
+        }
+
+        $store_id = $request->input('store_id');
+        $day = $request->input('day');
+        $callCustomers = array();
+        for ($d = 0; $d < $day; $d++) {
+            $StartO = mktime(0, 0, 0, date('m'), date('d'), date('y')) - 86400 * $d;
+            $EndO = $StartO + 86400;
+            $End = date('Y-m-d H:i:s', $EndO);
+            $Start = date('Y-m-d H:i:s', $StartO);
+            $callCustomer = AlbumWatchRecord::where([
+                ['store_id', $store_id],
+                ['action', 7],
+                ['updated_at','>=',$Start],
+                ['updated_at','<=',$End]
+            ])->orderByDesc('id')->count();
+            $callCustomers[] = [
+                'day' => date('m', $StartO) . '-' . date('d', $EndO),
+                'num' => $callCustomer
+            ];
+        }
+
+
+        return $this->api($callCustomers);
+    }
+
+    /**
+     * @api {post} /api/album_boss/agent_overview_favorite 经销商总览兴趣占比(agent_overview_favorite)
+     * @apiDescription 经销商总览兴趣占比(agent_overview_favorite)
+     * @apiGroup Boss
+     * @apiPermission none
+     * @apiVersion 0.1.0
+     * @apiParam {int}    [store_id]  商户id
+     * @apiParam {int}    [parent_id]  商户id
+     * @apiParam {int}    [start]     开始时间
+     * @apiParam {int}    [end]       结束时间
+     * @apiSuccessExample {json} Success-Response:
+     * HTTP/1.1 200 OK
+     * {
+     *     "status": true,
+     *     "status_code": 0,
+     *     "message": "",
+     *     "data": {
+     *          "arrFavorite": [
+     *              {
+     *                  'name':'asdawd',
+     *                  'point':'asdawd',
+     *                  'num':'1',
+     *              }
+     *          ]
+     *     }
+     * }
+     * @apiErrorExample {json} Error-Response:
+     * HTTP/1.1 400 Bad Request
+     * {
+     *     "state": false,
+     *     "code": 1000,
+     *     "message": "传入参数不正确",
+     *     "data": null or []
+     * }
+     * 可能出现的错误代码:
+     *    1000    CLIENT_WRONG_PARAMS             传入参数不正确
+     */
+    public function albumOverviewFavorite(Request $request)
+    {
+
+        $userAuth = Auth('api')->user();
+        if (!$userAuth) {
+            return $this->error(ErrorCode::ERROR_POWER, '登陆过期!');
+        }
+        $validator = Validator::make($request->all(), [
+            'store_id' => 'required',
+        ], [
+            'store_id.required' => '缺少商户参数',
+        ]);
+
+        if ($userAuth->role != 4) {
+            return $this->error(ErrorCode::NOT_BOSS, '该用户没有Boss权限');
+        }
+
+        if ($validator->fails()) {
+            return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '传入参数不正确!', $validator->messages());
+        }
+
+        $end = $request->input('end');
+        $start = $request->input('start');
+        $store_id = $request->input('store_id');
+        if (!$end) {
+            $end = time();
+        }
+        if (!$start) {
+            $start = 0;
+        }
+        $end = date('Y-m-d H:i:s', $end);
+        $start = date('Y-m-d H:i:s', $start);
+        $parent_id = $request->input('parent_id');
+        $cat = AlbumCatModel::where([['store_id',$store_id],['parent_id', $parent_id]])->get(['name','id'])->toArray();
+        $total = 0;
+        foreach ($cat as $key => $val) {
+            $count = CustomerCatRecordModel::where([
+                ['store_id',$store_id],
+                ['cat_id',$val['id']],
+                ['updated_at','>=',$start],
+                ['updated_at','<=',$end]
+            ])->count();
+            $total += $count;
+            $cat[$key]['num'] = $count;
+        }
+        foreach ($cat as $key => $val) {
+            if ($val['num'] == 0 || $total == 0) {
+                $cat[$key]['point'] = 0;
+            } else {
+                $cat[$key]['point'] = ($val['num'] / $total * 100) . '%';
+            }
+        }
+
+        return $this->api($cat);
+    }
+
+    /**
+     * @api {post} /api/album_boss/agent_overview_new 经销商总览新增客户(agent_overview_new)
+     * @apiDescription 经销商总览新增客户(agent_overview_new)
+     * @apiGroup Boss
+     * @apiPermission none
+     * @apiVersion 0.1.0
+     * @apiParam {int}    [store_id]  商户id
+     * @apiParam {int}    [day]  天数
+     * @apiSuccessExample {json} Success-Response:
+     * HTTP/1.1 200 OK
+     * {
+     *     "status": true,
+     *     "status_code": 0,
+     *     "message": "",
+     *     "data": {
+     *          "newCustomers": [
+     *              {
+     *                  "day" : 03/25,
+     *                  "num" : 111
+     *              }
+     *          ]
+     *     }
+     * }
+     * @apiErrorExample {json} Error-Response:
+     * HTTP/1.1 400 Bad Request
+     * {
+     *     "state": false,
+     *     "code": 1000,
+     *     "message": "传入参数不正确",
+     *     "data": null or []
+     * }
+     * 可能出现的错误代码:
+     *    1000    CLIENT_WRONG_PARAMS             传入参数不正确
+     */
+    public function albumOverviewNew(Request $request)
+    {
+
+        $userAuth = Auth('api')->user();
+        if (!$userAuth) {
+            return $this->error(ErrorCode::ERROR_POWER, '登陆过期!');
+        }
+        $validator = Validator::make($request->all(), [
+            'store_id' => 'required',
+        ], [
+            'store_id.required' => '缺少商户参数',
+        ]);
+
+        if ($userAuth->role != 4) {
+            return $this->error(ErrorCode::NOT_BOSS, '该用户没有Boss权限');
+        }
+
+        if ($validator->fails()) {
+            return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '传入参数不正确!', $validator->messages());
+        }
+
+        $store_id = $request->input('store_id');
+        $day = $request->input('day');
+        $newCustomers = array();
+        for ($d = 0; $d < $day; $d++) {
+            $StartO = mktime(0, 0, 0, date('m'), date('d'), date('y')) - 86400 * $d;
+            $EndO = $StartO + 86400;
+            $End = date('Y-m-d H:i:s', $EndO);
+            $Start = date('Y-m-d H:i:s', $StartO);
+            $newCustomer = AlbumWatchRecord::where([
+                ['store_id', $store_id],
+                ['is_new', 1],
+                ['updated_at','>=',$Start],
+                ['updated_at','<=',$End]
+            ])->orderByDesc('id')->count();
+            $newCustomers[] = [
+                'day' => date('m', $StartO) . '-' . date('d', $EndO),
+                'num' => $newCustomer
+            ];
+        }
+
+        return $this->api($newCustomers);
+    }
+
+    /**
+     * @api {post} /api/album_boss/agent_analysis 经销商分析(agent_analysis)
+     * @apiDescription 经销商分析(agent_analysis)
+     * @apiGroup Boss
+     * @apiPermission none
+     * @apiVersion 0.1.0
+     * @apiParam {int}    [store_id]  商户id
+     * @apiSuccessExample {json} Success-Response:
+     * HTTP/1.1 200 OK
+     * {
+     *     "status": true,
+     *     "status_code": 0,
+     *     "message": "",
+     *     "data": [
+     *         {
+     *             "realname" : 释迦摩尼,
+     *             "pointCount" : 111
+     *             "callCount" : 111
+     *             "favoriteCount" : 111
+     *             "get_count" : 111
+     *             "share_times" : 111
+     *             "newCount" : 111
+     *         }
+     *     ]
+     * }
+     * @apiErrorExample {json} Error-Response:
+     * HTTP/1.1 400 Bad Request
+     * {
+     *     "state": false,
+     *     "code": 1000,
+     *     "message": "传入参数不正确",
+     *     "data": null or []
+     * }
+     * 可能出现的错误代码:
+     *    1000    CLIENT_WRONG_PARAMS             传入参数不正确
+     */
+    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',
+        ], [
+            'store_id.required' => '缺少商户参数',
+        ]);
+        if ($userAuth->role != 4) {
+            return $this->error(ErrorCode::NOT_BOSS, '该用户没有Boss权限');
+        }
+        if ($validator->fails()) {
+            return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '传入参数不正确!', $validator->messages());
+        }
+        $store_id = $request->input('store_id');
+
+        $agent = AlbumAgentModel::where('store_id', $store_id)->orderByDesc('newCount')->paginate(12);
+        foreach ($agent as $value) {
+            $user = AlbumUserModel::where([['id', $value->user_id], ['store_id', $store_id]])->first(['avatar']);
+            $value->avatar = $user->avatar;
+        }
+        return $this->api($agent);
+    }
+}

+ 264 - 202
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
@@ -113,30 +113,30 @@ class AlbumController extends Controller
     public function albumXyxLogin(Request $request)
     {
         $datas = $request->input();
-        $validator = Validator::make($request->all(),
-            [
-                'code' => 'required',
-                'agent_id' => 'required',
-                'nickName' => 'required',
-                'iv' => 'required',
-                'encryptData' => 'required',
-                'avatar' => 'required',
-                'store_id' => 'required'
-            ],[
-                'code.required' => 'code不能为空!',
-                'agent_id.required' => 'agent_id不能为空!',
-                'nickName.required' => '昵称不能为空!',
-                'iv.required' => '偏移量不能为空!',
-                'encryptData.required' => '加密数据不能为空!',
-                'avatar.required' => '头像不能为空!',
-                'store_id.required' => '站点ID不能为空!'
-            ]
-        );
+        $validator = Validator::make($request->all(), [
+            'code' => 'required',
+            'agent_id' => 'required',
+            'nickName' => 'required',
+            'iv' => 'required',
+            'encryptData' => 'required',
+            'avatar' => 'required',
+            'store_id' => 'required'
+        ], [
+            'code.required' => 'code不能为空!',
+            'agent_id.required' => 'agent_id不能为空!',
+            'nickName.required' => '昵称不能为空!',
+            'iv.required' => '偏移量不能为空!',
+            'encryptData.required' => '加密数据不能为空!',
+            'avatar.required' => '头像不能为空!',
+            'store_id.required' => '站点ID不能为空!'
+        ]);
         if ($validator->fails()) {
             return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '传入参数不正确!', $validator->messages());
         }
-        $this->wechat_app = AlbumManufacturerModel::where('store_id',$datas['store_id'])->first();
-        if(!$this->wechat_app) return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '厂家参数未初始化!', $validator->messages());
+        $this->wechat_app = AlbumManufacturerModel::where('store_id', $datas['store_id'])->first();
+        if (!$this->wechat_app) {
+            return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '厂家参数未初始化!', $validator->messages());
+        }
         $config = [
             'app_id' => $this->wechat_app->xyx_id,
             'secret' => $this->wechat_app->xyx_secret,
@@ -162,60 +162,50 @@ class AlbumController extends Controller
             $check = AlbumUserModel::where([['wechat_union_id', $decryptedData['unionId']],['store_id',$datas['store_id']]])->first();
         }
 
-        if(!$check){
+        if (!$check) {
             $add['username'] = preg_replace('/[\xf0-\xf7].{3}/', '', $datas['nickName']);
             $add['open_id'] = $res['openid'];
-            $add['wechat_union_id'] = isset($decryptedData['unionId'])?$decryptedData['unionId']:'';
+            $add['wechat_union_id'] = isset($decryptedData['unionId']) ? $decryptedData['unionId'] : '';
             $add['avatar'] = $datas['avatar'];
-            $add['is_agent'] = 0;
+            $add['is_dealer'] = 0;
             $add['model'] = 1;
             $add['store_id'] = $datas['store_id'];
             $res = AlbumUserModel::create($add);
-            //  dd($res);
-            if($res){
-                $check = AlbumUserModel::where([['wechat_union_id',$res->wechat_union_id],['store_id',$datas['store_id']]])->first();
+            if ($res) {
+                $check = $res;
                 $user = [
-                    'user_id'=>$check['id'],
-                    //'avatar'=>$check['avatar'],
-                    // 'username'=>$check['username'],
-                    'phone'=>$check->phone,
-                    'is_agent'=>0,
-                    'agent_id'=>'',
+                    'user_id' => $check->id,
+                    'phone' => '',
+                    'is_agent' => 0,
+                    'agent_id' => '',
                 ];
-            }else{
-                $user=[
-                    'error'=>1
+            } else {
+                $user = [
+                    'error' => 1
                 ];
             }
         } else {
-            //print_r($check);die;
             $save['username'] = preg_replace('/[\xf0-\xf7].{3}/', '', $datas['nickName']);
             $save['avatar'] = $datas['avatar'];
-            // $save['open_id'] = $res['openid'];
             $save['model'] = 1;
-            AlbumUserModel::where('open_id',$res['openid'])->update($save);
-            //echo 111;
-            //print_r($check);die;
-            if($check->is_dealer == 1){
+            AlbumUserModel::where('open_id', $res['openid'])->update($save);
+            if ($check->is_dealer == 1) {
                 $user_agent = AlbumAgentModel::where([['user_id',$check->id],['status',1]])->first();
                 $agent_id = $user_agent['id'];
             } else {
                 $agent_id = '';
             }
             $user = [
-
-                'user_id'=>$check->id,
-                'phone'=>$check->phone,
-                'is_agent'=>$check->is_dealer,
-                'agent_id'=>$agent_id,
-
+                'user_id'  => $check->id,
+                'phone'    => $check->phone,
+                'is_agent' => $check->is_dealer,
+                'agent_id' => $agent_id,
             ];
         }
-        // echo 111;die;
         if (Auth::loginUsingId($check->id)) {
             $userAuth = Auth::user();
-            if($check->is_dealer ==0){
-                if($request->input('agent_id')!=0){
+            if ($check->is_dealer == 0) {
+                if ($request->input('agent_id') != 0) {
                     $userAuth->up_agent_id = $request->input('agent_id');
                 }
                 $add_record['agent_id'] = $userAuth->up_agent_id;
@@ -223,45 +213,57 @@ class AlbumController extends Controller
                 $add_record['action'] = 4;
                 $add_record['store_id'] = $datas['store_id'];
                 $add_record['detail'] = null;
+                $check_new_customer = AlbumWatchRecord::where([
+                    ['agent_id', $userAuth->up_agent_id],['open_id', $check->open_id],['store_id', $datas['store_id']]
+                ])->first();
+                if ($check_new_customer) {
+                    $add_record['is_new'] = 0;
+                } else {
+                    $add_record['is_new'] = 1;
+                }
+                $checkWatch = AlbumWatchRecord::where([['open_id',$check->open_id],['agent_id', $userAuth->up_agent_id]])->first();
                 AlbumWatchRecord::create($add_record);
-                //   dd($add_record);
-                // print_r($add_record['agent_id']);die;
                 $user_agent = AlbumAgentModel::where([['id',$add_record['agent_id']],['store_id',$datas['store_id']]])->first();
                 //dd($user_agent);
                 if ($user_agent) {
-                    $user_agent->get_count++;
+                    if (empty($checkWatch)) {
+                        $user_agent->get_count++;
+                    }
+                    $user_agent->pointCount++;
+                    $user_agent->newCount = $user_agent->pointCount + $user_agent->favoriteCount + $user_agent->callCount + $user_agent->share_times + $user_agent->get_count;
                     $user_agent->save();
                     $agent = AlbumUserModel::where([['id',$user_agent->user_id],['store_id',$datas['store_id']]])->first();
                     $this->sendLogsMessage($datas['store_id'], $agent->open_id, 4, $userAuth->username, $agent->g_open_id);
-                }else{
+                } else {
                     $userAuth->up_agent_id = 0;
                 }
-
-            }else{
+            } else {
                 $userAuth->up_agent_id = 0;
-            }//dd($userAuth);
+            }
             $userAuth->save();
             $user['up_agent_id'] = $userAuth->up_agent_id;
+            $user['role'] = $userAuth->role;
             if (!file_exists(public_path() . '/base/poster/avatar/' . $datas['store_id'])) {
                 mkdir(public_path() . '/base/poster/avatar/' . $datas['store_id'], 0755, true);
             }
             $res_image = getUrlImage($userAuth->avatar, public_path() . '/base/poster/avatar/' . $datas['store_id'] . "/$userAuth->id.jpg");
             imageToCircle($res_image);
             $token = $userAuth->createToken($userAuth->id . '-' . $userAuth->openid)->accessToken;
-            $conf = AlbumManufacturerModel::where('store_id',$datas['store_id'])->first();
+            $conf = AlbumManufacturerModel::where('store_id', $datas['store_id'])->first();
             $getPhone = $conf->getPhone;
             $getFocus = $conf->getFocus;
-            return $this->api(compact('token', 'user','getPhone','getFocus'));
+            return $this->api(compact('token', 'user', 'getPhone', 'getFocus'));
         } else {
             return $this->error(ErrorCode::INCORRECT_USER_OR_PASS);
         }
     }
 
 
-    /*
-    * curl get请求
-    */
-    public function curl_get($url)
+    /**
+     * @param $url
+     * @return mixed
+     */
+    public function curlGet($url)
     {
         //初始化
         $ch = curl_init();
@@ -275,22 +277,7 @@ class AlbumController extends Controller
         return $output;
     }
 
-    private function getOpenid($code)
-    {
-        $api = "https://api.weixin.qq.com/sns/jscode2session?appid={$this->wechat_app->app_id}&secret={$this->wechat_app->app_secret}&js_code={$code}&grant_type=authorization_code";
-        $res = $this->curl_get($api);
-        $res = json_decode($res, true);
-        return $res;
-    }
 
-    private function getOpenidxyx($code)
-    {
-        //$api = "https://api.weixin.qq.com/sns/jscode2session?appid={$this->wechat_app->xyx_id}&secret={$this->wechat_app->xyx_secret}&js_code={$code}&grant_type=authorization_code";
-        $api = "https://api.weixin.qq.com/sns/jscode2session?appid={$this->wechat_app->xyx_id}&secret={$this->wechat_app->xyx_secret}&js_code={$code}&grant_type=authorization_code";
-        $res = $this->curl_get($api);
-        $res = json_decode($res, true);
-        return $res;
-    }
     /**
      * @api {get} /api/album/goods 商品列表(goods)
      * @apiDescription 商品列表(goods)
@@ -340,22 +327,24 @@ class AlbumController extends Controller
         }
         $validator = Validator::make($request->all(), [
             'cat_id' => 'required',
+            'parent_id' => 'required',
             'store_id' => 'required',
         ], [
             'cat_id.required' => '缺少分类参数',
+            'parent_id.required' => '缺少父分类参数',
             'store_id.required' => '缺少商户参数',
         ]);
         if ($validator->fails()) {
             return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '传入参数不正确!', $validator->messages());
         }
         $data = $request->input();
-        //dd($data);
         $cat_id = request('cat_id');
         $store_id = request('store_id');
         $parent_id = request('parent_id');
-        $style = request('style_id');
 
-        $select_info = ['cat_id' => $cat_id, 'style' => $style];
+
+        $select_info = ['cat_id' => $cat_id,'parent_id' => $parent_id];
+
         if ($userAuth->up_agent_id != 0 && $cat_id != "undefined" && $parent_id != "undefined") {
             $add_record['agent_id'] = $userAuth->up_agent_id;
             $add_record['open_id'] = $userAuth->open_id;
@@ -373,8 +362,9 @@ class AlbumController extends Controller
         }
         if (isset($data['keywords']) && !empty($data['keywords'])) {
             $keywords = '%' . $data['keywords'] . '%';
-            $goods = AlbumProductModel::where([
-                ['name','like',$keywords],['store_id',$data['store_id']],['cat_id',$cat_id],['store_id',$store_id]]);
+
+            $goods = AlbumProductModel::where([['name','like',$keywords],['store_id',$data['store_id']],['cat_id',$cat_id],['store_id',$store_id]]);
+
         } else {
             $goods = AlbumProductModel::where([['cat_id',$cat_id],['store_id',$store_id]]);
         }
@@ -386,14 +376,17 @@ class AlbumController extends Controller
             $set_show_price = 0;
         }
 
+
         if ($userAuth->is_dealer == 1) {
             $agent_me = AlbumAgentModel::where('user_id', $userAuth->id)->first();
             $set_show_price = $agent_me->is_show_ma_price;
         }
 
+
         $goods = $goods->select('id', 'cover_pic', 'thumb', 'name', 'style', 'hot_cake', 'news', 'price_default', 'ma_price', 'ma_price_comment')
             ->orderByDesc('sort')->paginate(9);
 
+
         foreach ($goods as $key => $val) {
             if ($userAuth->is_dealer != 1) {
                 if ($userAuth->up_agent_id == 0) {
@@ -514,17 +507,16 @@ class AlbumController extends Controller
         }
         $ma = AlbumManufacturerModel::where('store_id', $store_id)->first();
         $goods = AlbumProductModel::where([['id',$goods_id],['store_id',$store_id]])->first();
-        $address = AlbumAgentModel::where('id', $userAuth->up_agent_id)->first();
+
         $cat_record['agent_id'] = $userAuth->up_agent_id;
         $cat_record['open_id'] = $userAuth->open_id;
         $cat_record['store_id'] = $store_id;
-        $cat_record['style_id'] = $goods->style;
         $cat_record['cat_id'] = $goods->cat_id;
         CustomerCatRecordModel::create($cat_record);
         if (!empty($goods) && $userAuth->is_dealer != 1) {
-            $price = DB::table('album_product_price')->where([
-                ['agent_id',$userAuth->up_agent_id],['store_id',$store_id],['product_id',$goods['id']]
-            ])->first();
+
+            $address = AlbumAgentModel::where('id', $userAuth->up_agent_id)->first();
+            $price = DB::table('album_product_price')->where([['agent_id',$userAuth->up_agent_id],['store_id',$store_id],['product_id',$goods['id']]])->first();
             if (!empty($price)) {
                 $goods->price = $price->price;
             } else {
@@ -540,8 +532,10 @@ class AlbumController extends Controller
                 $goods->favorite_id = '';
             }
         } elseif (!empty($goods) && $userAuth->is_dealer == 1) {
-            $agent_id = $address['id'];
-            $price = DB::table('album_product_price')->where([['agent_id',$agent_id],['store_id',$store_id],['product_id',$goods['id']]])->first();
+
+            $address = AlbumAgentModel::where([['store_id', $store_id],['user_id', $userAuth->id]])->first();
+            $price = DB::table('album_product_price')->where([['agent_id',$address->id],['store_id',$store_id],['product_id',$goods['id']]])->first();
+
             if (!empty($price)) {
                 $goods->price = $price->price;
             } else {
@@ -625,18 +619,20 @@ class AlbumController extends Controller
     public function albumFavoriteList(Request $request)
     {
         $userAuth = Auth('api')->user();
-        if(!$userAuth) return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '未登录!');
+        if (!$userAuth) {
+            return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '未登录!');
+        }
         $validator = Validator::make($request->all(), [
             'store_id' => 'required',
-        ],[
-            'store_id.required'=>'缺少商户参数',
+        ], [
+            'store_id.required' => '缺少商户参数',
         ]);
         if ($validator->fails()) {
             return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '传入参数不正确!', $validator->messages());
         }
         $data = $request->input();
         $favorite = AlbumFavoriteModel::where([['user_id',$userAuth->id],['store_id',$data['store_id']]])->get();
-        foreach ($favorite as $key=>$val) {
+        foreach ($favorite as $key => $val) {
             $favorite[$key]['goods'] = AlbumProductModel::where([['id',$val['product_id']],['store_id',$data['store_id']]])->first();
         }
         return $this->api($favorite);
@@ -689,92 +685,107 @@ class AlbumController extends Controller
     public function albumGetWatchRecord(Request $request)
     {
         $userAuth = Auth('api')->user();
-        if(!$userAuth) return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '未登录!');
+        if (!$userAuth) {
+            return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '未登录!');
+        }
         $validator = Validator::make($request->all(), [
             'store_id' => 'required',
-            'type'=>'required'
-        ],[
-            'store_id.required'=>'缺少商户参数',
-            'type.required'=>'缺少类型参数',
+            'type' => 'required'
+        ], [
+            'store_id.required' => '缺少商户参数',
+            'type.required' => '缺少类型参数',
         ]);
         if ($validator->fails()) {
             return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '传入参数不正确!', $validator->messages());
         }
         $type = $request->input('type');
         $store_id = $request->input('store_id');
-        if($userAuth->is_dealer!=1) return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '该用户不是经销商!', $validator->messages());
-        $user_agent = AlbumAgentModel::where('user_id',$userAuth->id)->first();
+        if ($userAuth->is_dealer != 1) {
+            return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '该用户不是经销商!', $validator->messages());
+        }
+        $user_agent = AlbumAgentModel::where('user_id', $userAuth->id)->first();
         $query = AlbumWatchRecord::where([['agent_id',$user_agent->id],['store_id',$store_id]]);
-        switch ($type){
+        switch ($type) {
             case '1':
-                if(!$request->input('user_id')) return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '传入参数不正确!');
+                if (!$request->input('user_id')) {
+                    return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '传入参数不正确!');
+                }
                 $user = AlbumUserModel::find(request('user_id'));
-                $query = $query->where('open_id',$user->open_id);
+                $query = $query->where('open_id', $user->open_id);
                 break;
             case '2':
-                if(!$request->input('start_time')||!$request->input('end_time')) return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '传入参数不正确!');
-                $start_time = date('Y-m-d H:i:s',$request->input('start_time'));
-                $end_time = date('Y-m-d H:i:s',$request->input('end_time'));//dd($start_time.';'.$end_time);
+                if (!$request->input('start_time') || !$request->input('end_time')) {
+                    return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '传入参数不正确!');
+                }
+                $start_time = date('Y-m-d H:i:s', $request->input('start_time'));
+                $end_time = date('Y-m-d H:i:s', $request->input('end_time'));
                 $query = $query->where([['created_at','>=',$start_time],['created_at','<=',$end_time]]);
-
                 break;
             case '3':
-                if(!$request->input('action')) return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '传入参数不正确!');
+                if (!$request->input('action')) {
+                    return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '传入参数不正确!');
+                }
                 $query = $query->where([['action',$request->input('action')]]);
                 break;
         }
         $res = $query->get();
         $action = '';
 
-        foreach($res as $key=>$val){
-            \Log::info('action:'.$val->action.',id:'.$val->id.';end');
-            if($val->action==4){
+        foreach ($res as $key => $val) {
+            \Log::info('action:' . $val->action . ',id:' . $val->id . ';end');
+            if ($val->action == 4) {
                 $action = '进入我的画册';
-            }elseif($val->action == 1||$val->action ==3){
-                $goods_data = json_decode($val->detail,true);
+            } elseif ($val->action == 1 || $val->action == 3) {
+                $goods_data = json_decode($val->detail, true);
                 $goods_id = $goods_data['goods_id'];
                 $goods = AlbumProductModel::find($goods_id);
                 if (!$goods) {
                     continue;
                 }
                 $cat = AlbumCatModel::find($goods->cat_id);
-                $style = AlbumProductStyleModel::find($goods->style);
-                $val->action == 1? $act = '收藏':$act = '查看';if(empty($style)||empty($cat)) continue;
-                $action = $act.'了您的'.$cat->name.'分类下的'.$style->name.'风格的商品 '.$goods->name;
-            }elseif($val->action == 2){
-                //dd(111);
-                $cat_data = json_decode($val->detail,true);
-                if($cat_data['cat_id']=="undefined"||$cat_data['style']=="undefined"||!$cat_data['style']||!$cat_data['cat_id']) continue;
+                $val->action == 1 ? $act = '收藏' : $act = '查看';
+                if (empty($cat)) {
+                    continue;
+                }
+                $action = $act . '了您的' . $cat->name . '分类下的商品 ' . $goods->name;
+            } elseif ($val->action == 2) {
+                $cat_data = json_decode($val->detail, true);
+                if ($cat_data['cat_id'] == "undefined" || !$cat_data['cat_id']) {
+                    continue;
+                }
                 $cat = AlbumCatModel::find($cat_data['cat_id']);
-                $style = AlbumProductStyleModel::find($cat_data['style']);
-                if(empty($style)||empty($cat)) continue;
-                $action = '浏览了您的 '.$cat->name.'分类下的 '.$style->name.'风格的商品列表';
-            }elseif($val->action==5){
-                $goods_data = json_decode($val->detail,true);
+                if (empty($cat)) {
+                    continue;
+                }
+                $action = '浏览了您的 ' . $cat->name . '分类下的商品列表';
+            } elseif ($val->action == 5) {
+                $goods_data = json_decode($val->detail, true);
                 $goods_id = $goods_data['goods_id'];
                 $goods = AlbumProductModel::find($goods_id);
                 if (!$goods) {
                     continue;
                 }
                 $cat = AlbumCatModel::find($goods->cat_id);
-                $style = AlbumProductStyleModel::find($goods->style);if(empty($style)||empty($cat)) continue;
-                $action = '点击了您的'.$cat->name.'分类下的'.$style->name.'风格的商品 '.$goods->name.'的'.$goods_data['detail'];
-            }elseif($val->action==6){
-                $detail = json_decode($val->detail,true);
+                if (empty($cat)) {
+                    continue;
+                }
+                $action = '点击了您的' . $cat->name . '分类下的商品 ' . $goods->name . '的' . $goods_data['detail'];
+            } elseif ($val->action == 6) {
+                $detail = json_decode($val->detail, true);
                 $address = $detail['detail'];
-                $action = '查看了您的地址'.$address.',并且点击了导航';
-            }elseif($val->action==7){
-                $detail = json_decode($val->detail,true);
+                $action = '查看了您的地址' . $address . ',并且点击了导航';
+            } elseif ($val->action == 7) {
+                $detail = json_decode($val->detail, true);
                 $phone = $detail['detail'];
-                $action = '查看了您的电话'.$phone.',并且点击了拨号';
+                $action = '查看了您的电话' . $phone . ',并且点击了拨号';
             }
-
-            $user = AlbumUserModel::where([['open_id',$val->open_id],['store_id',$val->store_id]])->select(['username','avatar','phone'])->first();
-            // dd(111);
+            $user = AlbumUserModel::where([
+                ['open_id',$val->open_id],['store_id',$val->store_id]
+            ])->select(['username','avatar','phone'])->first();
             $data_res[] = [
-                'time'=>$val->created_at,
-                'action'=>$action,
-                'user'=>$user
+                'time'   => $val->created_at,
+                'action' => $action,
+                'user'   => $user
             ];
         }
         return $this->api(compact('data_res'));
@@ -818,40 +829,43 @@ class AlbumController extends Controller
     public function albumGetDataGoods(Request $request)
     {
         $userAuth = Auth('api')->user();
-        if(!$userAuth) return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '未登录!');
+        if (!$userAuth) {
+            return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '未登录!');
+        }
         $validator = Validator::make($request->all(), [
             'store_id' => 'required'
-        ],[
-            'store_id.required'=>'缺少商户参数'
+        ], [
+            'store_id.required' => '缺少商户参数'
         ]);
         if ($validator->fails()) {
             return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '传入参数不正确!', $validator->messages());
         }
         $store_id = $request->input('store_id');
-        if($userAuth->is_dealer!=1) return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '该用户不是经销商!', $validator->messages());
+        if ($userAuth->is_dealer != 1) {
+            return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '该用户不是经销商!', $validator->messages());
+        }
 
-        $user_agent = AlbumAgentModel::where('user_id',$userAuth->id)->first();
+        $user_agent = AlbumAgentModel::where('user_id', $userAuth->id)->first();
         $res = AlbumWatchRecord::where([['agent_id',$user_agent->id],['store_id',$store_id],['action',3]])->get();
         $arr = array();
         $total = 0;
-
-        foreach($res as $key=>$val){
-            $goods_data = json_decode($val->detail,true);
+        foreach ($res as $key => $val) {
+            $goods_data = json_decode($val->detail, true);
             $goods_id = $goods_data['goods_id'];
             $goods = AlbumProductModel::find($goods_id);
             if (!$goods) {
                 continue;
             }
-            if(isset($arr[$goods->id])){
+            if (isset($arr[$goods->id])) {
                 $arr[$goods->id]['num']++;
-            }else{
-                $arr[$goods->id]['num']=1;
-                $arr[$goods->id]['name']=$goods->name;
+            } else {
+                $arr[$goods->id]['num'] = 1;
+                $arr[$goods->id]['name'] = $goods->name;
             }
             $total++;
         }
-        foreach($arr as $key=>$val){
-            $arr[$key]['point'] = ($val['num']/$total*100).'%';
+        foreach ($arr as $key => $val) {
+            $arr[$key]['point'] = ($val['num'] / $total * 100) . '%';
         }
         return $this->api(compact('arr'));
     }
@@ -864,7 +878,7 @@ class AlbumController extends Controller
      * @apiPermission 需要登录
      * @apiVersion 0.1.0
      * @apiParam {int}    [store_id]  商户id 模拟值为0
-     * @apiParam {int}    [style_id]
+     * @apiParam {int}    [parent_id]
      * @apiSuccessExample {json} Success-Response:
      * HTTP/1.1 200 OK
      * {
@@ -895,34 +909,38 @@ class AlbumController extends Controller
     public function albumGetDataCat(Request $request)
     {
         $userAuth = Auth('api')->user();
-        if(!$userAuth) return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '未登录!');
+        if (!$userAuth) {
+            return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '未登录!');
+        }
         $validator = Validator::make($request->all(), [
             'store_id' => 'required',
-            'style_id' => 'required'
-        ],[
-            'store_id.required'=>'缺少商户参数',
-            'style_id.required'=>'缺少风格参数',
+            'parent_id' => 'required'
+        ], [
+            'store_id.required' => '缺少商户参数',
+            'parent_id.required' => '缺少风格参数',
         ]);
         if ($validator->fails()) {
             return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '传入参数不正确!', $validator->messages());
         }
         $store_id = $request->input('store_id');
-        $style_id = $request->input('style_id');
-        if($userAuth->is_dealer!=1) return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '该用户不是经销商!', $validator->messages());
+        $parent_id = $request->input('parent_id');
+        if ($userAuth->is_dealer != 1) {
+            return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '该用户不是经销商!', $validator->messages());
+        }
 
-        $user_agent = AlbumAgentModel::where('user_id',$userAuth->id)->first();
-        $cat = AlbumCatModel::where('store_id',$store_id)->get(['name','id'])->toArray();
+        $user_agent = AlbumAgentModel::where('user_id', $userAuth->id)->first();
+        $cat = AlbumCatModel::where([['store_id',$store_id],['parent_id', $parent_id]])->get(['name','id'])->toArray();
         $total = 0;
-        foreach ($cat as $key=>$val){
-            $count = CustomerCatRecordModel::where([['agent_id',$user_agent->id],['store_id',$store_id],['style_id',$style_id],['cat_id',$val['id']]])->count();
+        foreach ($cat as $key => $val){
+            $count = CustomerCatRecordModel::where([['agent_id',$user_agent->id],['store_id',$store_id],['cat_id',$val['id']]])->count();
             $total += $count;
             $cat[$key]['num'] = $count;
         }
-        foreach($cat as $key=>$val){
-            if($val['num']==0||$total==0){
-                $cat[$key]['point']=0;
-            }else{
-                $cat[$key]['point'] = ($val['num']/$total*100).'%';
+        foreach ($cat as $key => $val) {
+            if ($val['num'] == 0 || $total == 0) {
+                $cat[$key]['point'] = 0;
+            } else {
+                $cat[$key]['point'] = ($val['num'] / $total * 100) . '%';
             }
         }
         return $this->api(compact('cat'));
@@ -937,6 +955,7 @@ class AlbumController extends Controller
      * @apiVersion 0.1.0
      * @apiParam {int}    [store_id]  商户id 模拟值为0
      * @apiParam {int}    [open_id]
+     * @apiParam {int}    [parent_id]
      * @apiSuccessExample {json} Success-Response:
      * HTTP/1.1 200 OK
      * {
@@ -967,16 +986,18 @@ class AlbumController extends Controller
     public function albumGetDataCatSingle(Request $request)
     {
         $userAuth = Auth('api')->user();
-        if(!$userAuth) return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '未登录!');
+        if (!$userAuth) {
+            return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '未登录!');
+        }
         $validator = Validator::make($request->all(), [
             'store_id' => 'required',
             'open_id' => 'required',
-           // 'end' => 'required',
-            //'start' => 'required',
-        ],[
-            'store_id.required'=>'缺少商户参数',
-            'open_id.required'=>'缺少风格参数',
-           // 'end.required'=>'缺少结束时间参数',
+            'parent_id' => 'required'
+        ], [
+            'store_id.required' => '缺少商户参数',
+            'open_id.required' => '缺少风格参数',
+            'parent_id.required' => '缺少父分类参数',
+            // 'end.required'=>'缺少结束时间参数',
             //'start.required'=>'缺少开始时间参数',
         ]);
         if ($validator->fails()) {
@@ -984,6 +1005,7 @@ class AlbumController extends Controller
         }
         $store_id = $request->input('store_id');
         $open_id = $request->input('open_id');
+        $parent_id = $request->input('parent_id');
         $end = $request->input('end');
         $start = $request->input('start');
         if (!$end) {
@@ -992,23 +1014,24 @@ class AlbumController extends Controller
         if (!$start) {
             $start = 0;
         }
-        $end= date('Y-m-d H:i:s',$end);
-        $start= date('Y-m-d H:i:s',$start);
-        if($userAuth->is_dealer!=1) return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '该用户不是经销商!', $validator->messages());
-
-        $user_agent = AlbumAgentModel::where('user_id',$userAuth->id)->first();
-        $cat = AlbumCatModel::where('store_id',$store_id)->get(['name','id'])->toArray();
+        $end = date('Y-m-d H:i:s', $end);
+        $start = date('Y-m-d H:i:s', $start);
+        if ($userAuth->is_dealer != 1) {
+            return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '该用户不是经销商!', $validator->messages());
+        }
+        $user_agent = AlbumAgentModel::where('user_id', $userAuth->id)->first();
+        $cat = AlbumCatModel::where([['store_id',$store_id],['parent_id',$parent_id]])->get(['name','id'])->toArray();
         $total = 0;
-        foreach ($cat as $key=>$val){
+        foreach ($cat as $key => $val) {
             $count = CustomerCatRecordModel::where([['agent_id',$user_agent->id],['store_id',$store_id],['open_id',$open_id],['cat_id',$val['id']],['updated_at','>=',$start],['updated_at','<=',$end]])->count();
             $total += $count;
             $cat[$key]['num'] = $count;
         }
-        foreach($cat as $key=>$val){
-            if($val['num']==0||$total==0){
-                $cat[$key]['point']=0;
-            }else{
-                $cat[$key]['point'] = ($val['num']/$total*100).'%';
+        foreach ($cat as $key => $val) {
+            if ($val['num'] == 0 || $total == 0) {
+                $cat[$key]['point'] = 0;
+            } else {
+                $cat[$key]['point'] = ($val['num'] / $total * 100) . '%';
             }
         }
         return $this->api(compact('cat'));
@@ -1063,15 +1086,17 @@ class AlbumController extends Controller
     public function albumGetCartOfWatch(Request $request)
     {
         $userAuth = Auth('api')->user();
-        if(!$userAuth) return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '未登录!');
+        if (!$userAuth) {
+            return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '未登录!');
+        }
         $validator = Validator::make($request->all(), [
             'store_id' => 'required',
             'end' => 'required',
             'start' => 'required',
-        ],[
-            'store_id.required'=>'缺少商户参数',
-            'end.required'=>'缺少结束时间参数',
-            'start.required'=>'缺少开始时间参数',
+        ], [
+            'store_id.required' => '缺少商户参数',
+            'end.required' => '缺少结束时间参数',
+            'start.required' => '缺少开始时间参数',
         ]);
         if ($validator->fails()) {
             return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '传入参数不正确!', $validator->messages());
@@ -1347,8 +1372,12 @@ class AlbumController extends Controller
             $add['favorite_times'] = 1;
             AlbumStatisticalModel::create($add);
         }
-        $select_info = ['goods_id'=>$data['product_id']];
-        if($userAuth->up_agent_id!=0){
+        $select_info = ['goods_id' => $data['product_id']];
+        if ($userAuth->up_agent_id != 0) {
+            $agent = AlbumAgentModel::where('id'. 'up_agent_id')->first();
+            $agent->favoriteCount++;
+            $agent->newCount = $agent->pointCount + $agent->favoriteCount + $agent->callCount + $agent->share_times + $agent->get_count;
+            $agent->save();
             $add_record['agent_id'] = $userAuth->up_agent_id;
             $add_record['open_id'] = $userAuth->open_id;
             $add_record['action'] = 1;
@@ -1532,6 +1561,7 @@ class AlbumController extends Controller
         $user_agent = AlbumAgentModel::where('user_id',$userAuth->id)->first();
         $agent_id = $user_agent['id'];
         $data = $request->all();
+        $product = AlbumProductModel::where('id', $data['goods_id'])->first();
         //print_r($data);
         $save = array();
         $return_data = array();
@@ -1541,6 +1571,8 @@ class AlbumController extends Controller
         if(empty($check)){
             $save['agent_id'] = $agent_id;
             $save['store_id'] = $data['store_id'];
+            $save['cat_id'] = $product->cat_id;
+            $save['name'] = $product->name;
             $save['product_id'] = $data['goods_id'];
             $res = AlbumProductPriceModel::create($save);
         }else{
@@ -1707,6 +1739,11 @@ class AlbumController extends Controller
             // dd($add_record);
             $res = AlbumWatchRecord::create($add_record);
             $user_agent = AlbumAgentModel::where('id',$userAuth->up_agent_id)->first();
+            if ($data['type'] == 7 || $data['type'] == 6) {
+                $user_agent->callCount++;
+                $user_agent->newCount = $user_agent->pointCount + $user_agent->favoriteCount + $user_agent->callCount + $user_agent->share_times + $user_agent->get_count;
+                $user_agent->save();
+            }
             $agent = AlbumUserModel::where('id',$user_agent->user_id)->first();
             if($res){
                 try{
@@ -1904,7 +1941,7 @@ class AlbumController extends Controller
         }
         $data = $request->input();
         $url = "https://apis.map.qq.com/ws/geocoder/v1/?address=".$data['address']."&key=".env('QQMAP');
-        $local = $this->curl_get($url);
+        $local = $this->curlGet($url);
         $res = json_decode($local,true);
         $agent_check = AlbumAgentModel::where([['store_id',$data['store_id']],['user_id',$userAuth->id]])->first();
         if($agent_check){
@@ -2338,6 +2375,7 @@ class AlbumController extends Controller
         if (!$end) {
             $end = time();
         }
+
         if (!$start) {
             $start = 0;
         }
@@ -2353,10 +2391,30 @@ class AlbumController extends Controller
             $goods_id = $detail['goods_id'];
             $goods = AlbumProductModel::where([['id',$goods_id]])->first();
             if($goods){
-                $style = AlbumProductStyleModel::where([['store_id',$store_id],['id',$goods->style]])->first();
                 $cat = AlbumCatModel::where([['store_id',$store_id],['id',$goods->cat_id]])->first();
-                $arr[] = ['name'=>$goods->name,'time'=>date('Y-m-d H:i',strtotime($val['created_at'])),'style'=>$style->name,'cat'=>$cat->name];
+                if (isset($arr[date('Y-m-d H:i', strtotime($val['created_at']))])) {
+                    if (isset($arr[date('Y-m-d H:i', strtotime($val['created_at']))][$goods->id])) {
+                        $arr[date('Y-m-d H:i', strtotime($val['created_at']))][$goods->id]['times']++;
+                    } else {
+                        $arr[date('Y-m-d H:i', strtotime($val['created_at']))][$goods->id] = [
+                            'name' => $goods->name,
+                            'cat' => $cat->name,
+                            'thumb' => $goods->thumb,
+                            'time' => date('Y-m-d H:i', strtotime($val['created_at'])),
+                            'times' => 1
+                        ];
+                    }
+                } else {
+                    $arr[date('Y-m-d H:i', strtotime($val['created_at']))][$goods->id] = [
+                        'name' => $goods->name,
+                        'cat' => $cat->name,
+                        'thumb' => $goods->thumb,
+                        'time' => date('Y-m-d H:i', strtotime($val['created_at'])),
+                        'times' => 1
+                    ];
+                }
             }
+            krsort($arr);
         }
         return $this->api($arr,0,'success');
     }
@@ -2519,10 +2577,10 @@ class AlbumController extends Controller
         }
         $store_id = $request->input('store_id');
         $goods_id = $request->input('goods_id');
-
         if($userAuth->up_agent_id !=0){
             $user_agent = AlbumAgentModel::where([['id',$userAuth->up_agent_id],['status',1]])->first();
             $user_agent->share_times++;
+            $user_agent->newCount = $user_agent->pointCount + $user_agent->favoriteCount + $user_agent->callCount + $user_agent->share_times + $user_agent->get_count;
             $user_agent->save();
         }
 
@@ -2705,6 +2763,7 @@ class AlbumController extends Controller
         $user_agent->is_show_ma_price = $data['is_show_ma_price'];
         $user_agent->save();
 
+
         $product = AlbumProductModel::where('store_id',$data['store_id'])->get(['id','ma_price']);
         foreach ($product as $key=>$val) {
             $save['price'] = $val['ma_price'] * (1 + $data['point'] / 100);
@@ -2712,6 +2771,8 @@ class AlbumController extends Controller
             if(empty($check)){
                 $save['agent_id'] = $user_agent->id;
                 $save['store_id'] = $data['store_id'];
+                $save['cat_id'] = $val['cat_id'];
+                $save['name'] = $val['name'];
                 $save['product_id'] = $val['id'];
                 AlbumProductPriceModel::create($save);
             }else{
@@ -2720,6 +2781,7 @@ class AlbumController extends Controller
         }
         $user_agent->set_price_point = $data['point'];
         $user_agent->save();
+
         return $this->api([],0,'success');
     }
 }

+ 19 - 0
app/Http/Controllers/Api/V1/AlbumPosterController.php

xqd xqd
@@ -11,6 +11,8 @@ namespace App\Http\Controllers\Api\V1;
 use App\Models\AlbumAgentModel;
 use App\Models\AlbumManufacturerModel;
 use App\Models\AlbumPosterModel;
+use App\Models\AlbumUserModel;
+use App\Models\AlbumWatchRecord;
 use App\Services\Base\ErrorCode;
 use EasyWeChat\Factory;
 use Grafika\Color;
@@ -215,7 +217,24 @@ class AlbumPosterController extends Controller
         } else {
             $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['detail'] = '保存了图片';
+            $user_agent = AlbumAgentModel::where('id', $userAuth->up_agent_id)->first();
+            $agent = AlbumUserModel::where('id', $user_agent->user_id)->first();
+
+            $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();
         $editor = Grafika::createEditor();
         $editor->open($image_poster, public_path() . '/base/poster/img/poster_canvas.png');

+ 2 - 1
app/Http/Controllers/Api/V1/Controller.php

xqd
@@ -22,7 +22,8 @@ class Controller extends BaseController
         $this->middleware('auth:api', [
             'except' => [
                 'upload', 'getCode', 'reset', 'login', 'get', 'register', 'alipayNotify', 'wechatpayNotify', 'get', 'area', 'get_province', 'get_city', 'get_county', 'albumStyle', 'test', 'index', 'companyInfo', 'shop2', 'cardIndex', 'cardUserInfo', 'cardUserProgress', 'cardUserHonor', 'cardUserProject', 'CardUserTrend', 'projectDetail', 'trendDetail', 'albumSetting', 'albumXyxLogin', 'albumCat', 'albumchecklogin', 'albumGoods', 'albumGoodsDetail', 'albumSetPrice', 'albumXcxLogin', 'albumContentList', 'albumSearchGoods','albumContentDetail','albumFavoriteList','albumAddFavorite','albumFavoriteDel','getAttr','getOrder','getProgress','getReviewCount', 'furnitureNewsDetail','furnitureSetting','furnitureXcxLogin','furnitureGoodsList','serviceLogin','getFurnitureAds','getPhoneNumber','getQrcode','orderCount','searchList','printOrder','saveFormId','furnitureNewsList','getMoreComments','addToLike','albumSavePhone','albumGetStatistical','test',
-                'albumGetWatchRecord','albumSetWatch','albumGetCartOfWatch','albumSaveFormId','albumAddAgent','albumGetBanner','albumGetDataGoods','newgoods_list','newgoods_index','albumGetAgentAdress','albumSetCustomer','albumGetCustomer','albumGetDataCat','albumCustomerGoods','albumCustomerGoodsDetail','albumGetDataCatSingle','albumGetCountOfFavorite','albumGetUserInfo','albumStatistical','posterInfo','createPoster','posterDel','albumAgentPriceSet'
+                'albumGetWatchRecord','albumSetWatch','albumGetCartOfWatch','albumSaveFormId','albumAddAgent','albumGetBanner','albumGetDataGoods','newgoods_list','newgoods_index','albumGetAgentAdress','albumSetCustomer','albumGetCustomer','albumGetDataCat','albumCustomerGoods','albumCustomerGoodsDetail','albumGetDataCatSingle','albumGetCountOfFavorite','albumGetUserInfo','albumStatistical','posterInfo','createPoster','posterDel','albumAgentPriceSet', 'getTop', 'agentCustomer'
+                , 'agentStatistical', 'albumOverviewActive', 'albumOverviewLeft', 'albumOverviewFavorite', 'albumOverviewNew', 'agentAnalysis', 'albumOverviewFunnel', 'albumOverviewCall'
             ]
         ]);
 

+ 4 - 0
app/Models/AlbumAgentModel.php

xqd
@@ -53,6 +53,10 @@ class AlbumAgentModel extends BaseModel
         'status',
         'realname',
         'get_count',
+        'callCount',
+        'newCount',
+        'pointCount',
+        'favoriteCount',
         'share_times'
     ];
 

+ 0 - 1
app/Models/AlbumCatModel.php

xqd
@@ -39,7 +39,6 @@ class AlbumCatModel extends BaseModel
                            'name',
                            'sort',
                            'parent_id',
-                           'level',
                            'pic_url',
                             'store_id'
                           ];

+ 2 - 0
app/Models/AlbumProductPriceModel.php

xqd
@@ -32,6 +32,8 @@ class AlbumProductPriceModel extends BaseModel
      */
     protected $fillable = [
                            'agent_id',
+                           'name',
+                           'cat_id',
                            'store_id',
                            'product_id',
                            'mobile',

+ 3 - 0
app/Models/AlbumUserModel.php

xqd
@@ -40,6 +40,9 @@ class AlbumUserModel extends Authenticatable
     protected $fillable = [
         'username',
         'wechat_open_id',
+        'address',
+        'lng',
+        'lat',
         'g_open_id',
         'open_id',
         'wechat_union_id',

+ 1 - 1
app/Models/CustomerCatRecordModel.php

xqd
@@ -31,6 +31,6 @@ class CustomerCatRecordModel extends BaseModel
         'store_id',
         'open_id',
         'cat_id',
-        'style_id',
+        'parent_id',
     ];
 }

+ 13 - 12
app/Repositories/Album/Criteria/CatWhere.php

xqd xqd
@@ -14,17 +14,20 @@ 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)
+    public function __construct(array $search, int $pid, int $store_id)
     {
         $this->search = $search;
         $this->pid = $pid;
@@ -33,17 +36,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;
     }

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

+ 9 - 9
app/Repositories/Album/Criteria/ProductWhere.php

xqd xqd
@@ -14,16 +14,18 @@ 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)
+    public function __construct(array $search, int $store_id)
     {
         $this->search = $search;
         $this->store_id = $store_id;
@@ -31,17 +33,15 @@ class ProductWhere extends Criteria {
 
     /**
      * @param $model
-     * @param RepositoryInterface $repository
+     * @param Repository $repository
      * @return mixed
      */
     public function apply($model, Repository $repository)
     {
-        if(isset($this->search['keyword']) && $this->search['keyword']) {
-            $keyword = '%'.$this->search['keyword'].'%';
+        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 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]]);
         }

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

xqd
@@ -25,7 +25,7 @@ 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);
             });
         }
 

+ 3 - 2
app/Services/Base/Attachment.php

xqd xqd
@@ -12,12 +12,13 @@
 
 namespace App\Services\Base;
 
+use App\Http\Controllers\Admin\Controller;
 use App\Models\BaseAttachmentModel;
 use Grafika\Grafika;
 use Response;
 use App\Models\BaseSettingsModel;
 use Image;
-class Attachment
+class Attachment extends Controller
 {
     private $_model;
 
@@ -232,7 +233,7 @@ class Attachment
             $attachment->path = $real_path;
             $attachment->url = $url_path;
             $attachment->size = $fileSize;
-
+            $attachment->store_id = $this->getStoreId();
             $attachment->file_type = $fileMimeType;
             $attachment->class = $class;
             if ($attachment->save()) {

+ 2 - 0
app/Services/Base/ErrorCode.php

xqd xqd
@@ -14,6 +14,7 @@ namespace App\Services\Base;
 
 final class ErrorCode {
     //错误常量定义
+    const NOT_BOSS = 606;
     const ATTACHMENT_DELETE_FAILED = 605;
     const ATTACHMENT_MOVE_FAILED = 604;
     const ATTACHMENT_RECORD_DELETE_FAILED = 606;
@@ -76,6 +77,7 @@ final class ErrorCode {
 
     //错误常量枚举
     private static $_msg = [
+        self::NOT_BOSS => '该用户没有Boss权限',
         self::ORDER_NOT_EXIST => '订单没有找到',
         self::APPID_NOT_EXIST => 'appid不存在',
         self::ADDRESS_NOT_EXIST => '地址不存在',

+ 35 - 0
database/migrations/2019_04_14_105335_add_address_info_to_album_user.php

xqd
@@ -0,0 +1,35 @@
+<?php
+
+use Illuminate\Support\Facades\Schema;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Database\Migrations\Migration;
+
+class AddAddressInfoToAlbumUser extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::table('album_user', function (Blueprint $table) {
+            //
+            $table->string('address', 255)->nullable()->default(null)->comment('地址');
+            $table->string('lng', 100)->nullable()->default(null);
+            $table->string('lat', 100)->nullable()->default(null);
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::table('album_user', function (Blueprint $table) {
+            //
+        });
+    }
+}

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

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

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

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

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

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

+ 35 - 0
database/migrations/2019_04_16_201403_add_st_column_to_album_agent.php

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

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

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

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

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

+ 555 - 1
public/apidoc/api_data.js

xqd xqd xqd
@@ -1175,7 +1175,7 @@ define({ "api": [
             "group": "Parameter",
             "type": "int",
             "optional": true,
-            "field": "style_id",
+            "field": "parent_id",
             "description": ""
           }
         ]
@@ -1231,6 +1231,13 @@ define({ "api": [
             "optional": true,
             "field": "open_id",
             "description": ""
+          },
+          {
+            "group": "Parameter",
+            "type": "int",
+            "optional": true,
+            "field": "parent_id",
+            "description": ""
           }
         ]
       }
@@ -2041,6 +2048,553 @@ define({ "api": [
     "groupTitle": "Auth",
     "name": "PostApiAuthLogin"
   },
+  {
+    "type": "get",
+    "url": "/api/album_boss/get_top",
+    "title": "经销商排行榜(get_top)",
+    "description": "<p>经销商排行榜(get_top)</p>",
+    "group": "Boss",
+    "permission": [
+      {
+        "name": "none"
+      }
+    ],
+    "version": "0.1.0",
+    "parameter": {
+      "fields": {
+        "Parameter": [
+          {
+            "group": "Parameter",
+            "type": "int",
+            "optional": true,
+            "field": "store_id",
+            "description": "<p>商户id</p>"
+          }
+        ]
+      }
+    },
+    "success": {
+      "examples": [
+        {
+          "title": "Success-Response:",
+          "content": "HTTP/1.1 200 OK\n{\n    \"status\": true,\n    \"status_code\": 0,\n    \"message\": \"\",\n    \"data\": {\n        \"agent\": [\n             {\n                 \"id\": 3,\n                 \"avatar\": \"http://admin.xcx.com/upload/images/20180519/02f2dbe0e1046d7cea8b3b52d5642fb8.jpg\",\n                 \"name\": \"张三\",\n                 \"get_count\": \"客户数量\",\n             }\n         ],\n    }\n}",
+          "type": "json"
+        }
+      ]
+    },
+    "error": {
+      "examples": [
+        {
+          "title": "Error-Response:",
+          "content": "HTTP/1.1 400 Bad Request\n{\n    \"state\": false,\n    \"code\": 1000,\n    \"message\": \"传入参数不正确\",\n    \"data\": null or []\n}\n可能出现的错误代码:\n   1000    CLIENT_WRONG_PARAMS             传入参数不正确",
+          "type": "json"
+        }
+      ]
+    },
+    "filename": "app/Http/Controllers/Api/V1/AlbumBossController.php",
+    "groupTitle": "Boss",
+    "name": "GetApiAlbum_bossGet_top"
+  },
+  {
+    "type": "post",
+    "url": "/api/album_boss/agent_analysis",
+    "title": "经销商分析(agent_analysis)",
+    "description": "<p>经销商分析(agent_analysis)</p>",
+    "group": "Boss",
+    "permission": [
+      {
+        "name": "none"
+      }
+    ],
+    "version": "0.1.0",
+    "parameter": {
+      "fields": {
+        "Parameter": [
+          {
+            "group": "Parameter",
+            "type": "int",
+            "optional": true,
+            "field": "store_id",
+            "description": "<p>商户id</p>"
+          }
+        ]
+      }
+    },
+    "success": {
+      "examples": [
+        {
+          "title": "Success-Response:",
+          "content": "HTTP/1.1 200 OK\n{\n    \"status\": true,\n    \"status_code\": 0,\n    \"message\": \"\",\n    \"data\": [\n        {\n            \"realname\" : 释迦摩尼,\n            \"pointCount\" : 111\n            \"callCount\" : 111\n            \"favoriteCount\" : 111\n            \"get_count\" : 111\n            \"share_times\" : 111\n            \"newCount\" : 111\n        }\n    ]\n}",
+          "type": "json"
+        }
+      ]
+    },
+    "error": {
+      "examples": [
+        {
+          "title": "Error-Response:",
+          "content": "HTTP/1.1 400 Bad Request\n{\n    \"state\": false,\n    \"code\": 1000,\n    \"message\": \"传入参数不正确\",\n    \"data\": null or []\n}\n可能出现的错误代码:\n   1000    CLIENT_WRONG_PARAMS             传入参数不正确",
+          "type": "json"
+        }
+      ]
+    },
+    "filename": "app/Http/Controllers/Api/V1/AlbumBossController.php",
+    "groupTitle": "Boss",
+    "name": "PostApiAlbum_bossAgent_analysis"
+  },
+  {
+    "type": "post",
+    "url": "/api/album_boss/agent_customer",
+    "title": "经销商客户(agent_customer)",
+    "description": "<p>经销商客户(agent_customer)</p>",
+    "group": "Boss",
+    "permission": [
+      {
+        "name": "none"
+      }
+    ],
+    "version": "0.1.0",
+    "parameter": {
+      "fields": {
+        "Parameter": [
+          {
+            "group": "Parameter",
+            "type": "int",
+            "optional": true,
+            "field": "store_id",
+            "description": "<p>商户id</p>"
+          },
+          {
+            "group": "Parameter",
+            "type": "int",
+            "optional": true,
+            "field": "agent_id",
+            "description": "<p>经销商id</p>"
+          }
+        ]
+      }
+    },
+    "success": {
+      "examples": [
+        {
+          "title": "Success-Response:",
+          "content": "HTTP/1.1 200 OK\n{\n    \"status\": true,\n    \"status_code\": 0,\n    \"message\": \"\",\n    \"data\": {\n        \"agent\": [\n             {\n                 \"id\": 3,\n                 \"avatar\": \"http://admin.xcx.com/upload/images/20180519/02f2dbe0e1046d7cea8b3b52d5642fb8.jpg\",\n                 \"name\": \"张三\",\n                 \"address\": \"四川省\",\n                 \"phone\": \"8208208820\",\n                 \"lon\": \"100.123123\",\n                 \"lat\": \"123.123123\",\n             }\n         ],\n        \"customer\": [\n             {\n                 \"id\": 3,\n                 \"avatar\": \"http://admin.xcx.com/upload/images/20180519/02f2dbe0e1046d7cea8b3b52d5642fb8.jpg\",\n                 \"name\": \"张三\",\n                 \"address\": \"四川省甘肃市\"\n              }\n         ]\n    }\n}",
+          "type": "json"
+        }
+      ]
+    },
+    "error": {
+      "examples": [
+        {
+          "title": "Error-Response:",
+          "content": "HTTP/1.1 400 Bad Request\n{\n    \"state\": false,\n    \"code\": 1000,\n    \"message\": \"传入参数不正确\",\n    \"data\": null or []\n}\n可能出现的错误代码:\n   1000    CLIENT_WRONG_PARAMS             传入参数不正确",
+          "type": "json"
+        }
+      ]
+    },
+    "filename": "app/Http/Controllers/Api/V1/AlbumBossController.php",
+    "groupTitle": "Boss",
+    "name": "PostApiAlbum_bossAgent_customer"
+  },
+  {
+    "type": "post",
+    "url": "/api/album_boss/agent_overview_active",
+    "title": "经销商总览活跃客户(agent_overview_active)",
+    "description": "<p>经销商总览活跃客户(agent_overview_active)</p>",
+    "group": "Boss",
+    "permission": [
+      {
+        "name": "none"
+      }
+    ],
+    "version": "0.1.0",
+    "parameter": {
+      "fields": {
+        "Parameter": [
+          {
+            "group": "Parameter",
+            "type": "int",
+            "optional": true,
+            "field": "store_id",
+            "description": "<p>商户id</p>"
+          }
+        ]
+      }
+    },
+    "success": {
+      "examples": [
+        {
+          "title": "Success-Response:",
+          "content": "HTTP/1.1 200 OK\n{\n    \"status\": true,\n    \"status_code\": 0,\n    \"message\": \"\",\n    \"data\": {\n        \"activeCustomers\": [\n             {\n                 \"day\" : 03/25,\n                 \"num\" : 111\n             }\n         ],\n    }\n}",
+          "type": "json"
+        }
+      ]
+    },
+    "error": {
+      "examples": [
+        {
+          "title": "Error-Response:",
+          "content": "HTTP/1.1 400 Bad Request\n{\n    \"state\": false,\n    \"code\": 1000,\n    \"message\": \"传入参数不正确\",\n    \"data\": null or []\n}\n可能出现的错误代码:\n   1000    CLIENT_WRONG_PARAMS             传入参数不正确",
+          "type": "json"
+        }
+      ]
+    },
+    "filename": "app/Http/Controllers/Api/V1/AlbumBossController.php",
+    "groupTitle": "Boss",
+    "name": "PostApiAlbum_bossAgent_overview_active"
+  },
+  {
+    "type": "post",
+    "url": "/api/album_boss/agent_overview_call",
+    "title": "经销商总览咨询(agent_overview_call)",
+    "description": "<p>经销商总览咨询(agent_overview_call)</p>",
+    "group": "Boss",
+    "permission": [
+      {
+        "name": "none"
+      }
+    ],
+    "version": "0.1.0",
+    "parameter": {
+      "fields": {
+        "Parameter": [
+          {
+            "group": "Parameter",
+            "type": "int",
+            "optional": true,
+            "field": "store_id",
+            "description": "<p>商户id</p>"
+          },
+          {
+            "group": "Parameter",
+            "type": "int",
+            "optional": true,
+            "field": "day",
+            "description": "<p>天数</p>"
+          }
+        ]
+      }
+    },
+    "success": {
+      "examples": [
+        {
+          "title": "Success-Response:",
+          "content": "HTTP/1.1 200 OK\n{\n    \"status\": true,\n    \"status_code\": 0,\n    \"message\": \"\",\n    \"data\": {\n         \"callCustomers\": [\n             {\n                 \"day\" : 03/25,\n                 \"num\" : 111\n             }\n         ]\n    }\n}",
+          "type": "json"
+        }
+      ]
+    },
+    "error": {
+      "examples": [
+        {
+          "title": "Error-Response:",
+          "content": "HTTP/1.1 400 Bad Request\n{\n    \"state\": false,\n    \"code\": 1000,\n    \"message\": \"传入参数不正确\",\n    \"data\": null or []\n}\n可能出现的错误代码:\n   1000    CLIENT_WRONG_PARAMS             传入参数不正确",
+          "type": "json"
+        }
+      ]
+    },
+    "filename": "app/Http/Controllers/Api/V1/AlbumBossController.php",
+    "groupTitle": "Boss",
+    "name": "PostApiAlbum_bossAgent_overview_call"
+  },
+  {
+    "type": "post",
+    "url": "/api/album_boss/agent_overview_favorite",
+    "title": "经销商总览兴趣占比(agent_overview_favorite)",
+    "description": "<p>经销商总览兴趣占比(agent_overview_favorite)</p>",
+    "group": "Boss",
+    "permission": [
+      {
+        "name": "none"
+      }
+    ],
+    "version": "0.1.0",
+    "parameter": {
+      "fields": {
+        "Parameter": [
+          {
+            "group": "Parameter",
+            "type": "int",
+            "optional": true,
+            "field": "store_id",
+            "description": "<p>商户id</p>"
+          },
+          {
+            "group": "Parameter",
+            "type": "int",
+            "optional": true,
+            "field": "parent_id",
+            "description": "<p>商户id</p>"
+          },
+          {
+            "group": "Parameter",
+            "type": "int",
+            "optional": true,
+            "field": "start",
+            "description": "<p>开始时间</p>"
+          },
+          {
+            "group": "Parameter",
+            "type": "int",
+            "optional": true,
+            "field": "end",
+            "description": "<p>结束时间</p>"
+          }
+        ]
+      }
+    },
+    "success": {
+      "examples": [
+        {
+          "title": "Success-Response:",
+          "content": "HTTP/1.1 200 OK\n{\n    \"status\": true,\n    \"status_code\": 0,\n    \"message\": \"\",\n    \"data\": {\n         \"arrFavorite\": [\n             {\n                 'name':'asdawd',\n                 'point':'asdawd',\n                 'num':'1',\n             }\n         ]\n    }\n}",
+          "type": "json"
+        }
+      ]
+    },
+    "error": {
+      "examples": [
+        {
+          "title": "Error-Response:",
+          "content": "HTTP/1.1 400 Bad Request\n{\n    \"state\": false,\n    \"code\": 1000,\n    \"message\": \"传入参数不正确\",\n    \"data\": null or []\n}\n可能出现的错误代码:\n   1000    CLIENT_WRONG_PARAMS             传入参数不正确",
+          "type": "json"
+        }
+      ]
+    },
+    "filename": "app/Http/Controllers/Api/V1/AlbumBossController.php",
+    "groupTitle": "Boss",
+    "name": "PostApiAlbum_bossAgent_overview_favorite"
+  },
+  {
+    "type": "post",
+    "url": "/api/album_boss/agent_overview_funnel",
+    "title": "经销商总览漏斗(agent_overview_funnel)",
+    "description": "<p>经销商总览漏斗(agent_overview_funnel)</p>",
+    "group": "Boss",
+    "permission": [
+      {
+        "name": "none"
+      }
+    ],
+    "version": "0.1.0",
+    "parameter": {
+      "fields": {
+        "Parameter": [
+          {
+            "group": "Parameter",
+            "type": "int",
+            "optional": true,
+            "field": "store_id",
+            "description": "<p>商户id</p>"
+          }
+        ]
+      }
+    },
+    "success": {
+      "examples": [
+        {
+          "title": "Success-Response:",
+          "content": "HTTP/1.1 200 OK\n{\n    \"status\": true,\n    \"status_code\": 0,\n    \"message\": \"\",\n    \"data\": {\n        \"customerFollow\":11,\n        \"shareCount\":11,\n        \"totalCustomerCount\":11,\n    }\n}",
+          "type": "json"
+        }
+      ]
+    },
+    "error": {
+      "examples": [
+        {
+          "title": "Error-Response:",
+          "content": "HTTP/1.1 400 Bad Request\n{\n    \"state\": false,\n    \"code\": 1000,\n    \"message\": \"传入参数不正确\",\n    \"data\": null or []\n}\n可能出现的错误代码:\n   1000    CLIENT_WRONG_PARAMS             传入参数不正确",
+          "type": "json"
+        }
+      ]
+    },
+    "filename": "app/Http/Controllers/Api/V1/AlbumBossController.php",
+    "groupTitle": "Boss",
+    "name": "PostApiAlbum_bossAgent_overview_funnel"
+  },
+  {
+    "type": "post",
+    "url": "/api/album_boss/agent_overview_left",
+    "title": "经销商总览左侧(agent_overview_left)",
+    "description": "<p>经销商总览左侧(agent_overview_left)</p>",
+    "group": "Boss",
+    "permission": [
+      {
+        "name": "none"
+      }
+    ],
+    "version": "0.1.0",
+    "parameter": {
+      "fields": {
+        "Parameter": [
+          {
+            "group": "Parameter",
+            "type": "int",
+            "optional": true,
+            "field": "store_id",
+            "description": "<p>商户id</p>"
+          },
+          {
+            "group": "Parameter",
+            "type": "int",
+            "optional": true,
+            "field": "start",
+            "description": "<p>开始时间</p>"
+          },
+          {
+            "group": "Parameter",
+            "type": "int",
+            "optional": true,
+            "field": "end",
+            "description": "<p>结束时间</p>"
+          }
+        ]
+      }
+    },
+    "success": {
+      "examples": [
+        {
+          "title": "Success-Response:",
+          "content": "HTTP/1.1 200 OK\n{\n    \"status\": true,\n    \"status_code\": 0,\n    \"message\": \"\",\n    \"data\": {\n        \"customerFollow\":11,\n        \"downloadCount\":11,\n        \"shareCount\":11,\n        \"newCustomerCount\":11,\n        \"totalCustomerCount\":11,\n    }\n}",
+          "type": "json"
+        }
+      ]
+    },
+    "error": {
+      "examples": [
+        {
+          "title": "Error-Response:",
+          "content": "HTTP/1.1 400 Bad Request\n{\n    \"state\": false,\n    \"code\": 1000,\n    \"message\": \"传入参数不正确\",\n    \"data\": null or []\n}\n可能出现的错误代码:\n   1000    CLIENT_WRONG_PARAMS             传入参数不正确",
+          "type": "json"
+        }
+      ]
+    },
+    "filename": "app/Http/Controllers/Api/V1/AlbumBossController.php",
+    "groupTitle": "Boss",
+    "name": "PostApiAlbum_bossAgent_overview_left"
+  },
+  {
+    "type": "post",
+    "url": "/api/album_boss/agent_overview_new",
+    "title": "经销商总览新增客户(agent_overview_new)",
+    "description": "<p>经销商总览新增客户(agent_overview_new)</p>",
+    "group": "Boss",
+    "permission": [
+      {
+        "name": "none"
+      }
+    ],
+    "version": "0.1.0",
+    "parameter": {
+      "fields": {
+        "Parameter": [
+          {
+            "group": "Parameter",
+            "type": "int",
+            "optional": true,
+            "field": "store_id",
+            "description": "<p>商户id</p>"
+          },
+          {
+            "group": "Parameter",
+            "type": "int",
+            "optional": true,
+            "field": "day",
+            "description": "<p>天数</p>"
+          }
+        ]
+      }
+    },
+    "success": {
+      "examples": [
+        {
+          "title": "Success-Response:",
+          "content": "HTTP/1.1 200 OK\n{\n    \"status\": true,\n    \"status_code\": 0,\n    \"message\": \"\",\n    \"data\": {\n         \"newCustomers\": [\n             {\n                 \"day\" : 03/25,\n                 \"num\" : 111\n             }\n         ]\n    }\n}",
+          "type": "json"
+        }
+      ]
+    },
+    "error": {
+      "examples": [
+        {
+          "title": "Error-Response:",
+          "content": "HTTP/1.1 400 Bad Request\n{\n    \"state\": false,\n    \"code\": 1000,\n    \"message\": \"传入参数不正确\",\n    \"data\": null or []\n}\n可能出现的错误代码:\n   1000    CLIENT_WRONG_PARAMS             传入参数不正确",
+          "type": "json"
+        }
+      ]
+    },
+    "filename": "app/Http/Controllers/Api/V1/AlbumBossController.php",
+    "groupTitle": "Boss",
+    "name": "PostApiAlbum_bossAgent_overview_new"
+  },
+  {
+    "type": "post",
+    "url": "/api/album_boss/agent_statistical",
+    "title": "经销商数据(agent_statistical)",
+    "description": "<p>经销商数据(agent_statistical)</p>",
+    "group": "Boss",
+    "permission": [
+      {
+        "name": "none"
+      }
+    ],
+    "version": "0.1.0",
+    "parameter": {
+      "fields": {
+        "Parameter": [
+          {
+            "group": "Parameter",
+            "type": "int",
+            "optional": true,
+            "field": "store_id",
+            "description": "<p>商户id</p>"
+          },
+          {
+            "group": "Parameter",
+            "type": "int",
+            "optional": true,
+            "field": "agent_id",
+            "description": "<p>经销商id</p>"
+          },
+          {
+            "group": "Parameter",
+            "type": "int",
+            "optional": true,
+            "field": "start",
+            "description": "<p>开始时间</p>"
+          },
+          {
+            "group": "Parameter",
+            "type": "int",
+            "optional": true,
+            "field": "end",
+            "description": "<p>结束时间</p>"
+          }
+        ]
+      }
+    },
+    "success": {
+      "examples": [
+        {
+          "title": "Success-Response:",
+          "content": "HTTP/1.1 200 OK\n{\n    \"status\": true,\n    \"status_code\": 0,\n    \"message\": \"\",\n    \"data\": {\n        \"favoriteCount\":11,\n        \"downloadCount\":11,\n        \"shareCount\":11,\n        \"newCustomerCount\":11,\n        \"totalCustomerCount\":11,\n    }\n}",
+          "type": "json"
+        }
+      ]
+    },
+    "error": {
+      "examples": [
+        {
+          "title": "Error-Response:",
+          "content": "HTTP/1.1 400 Bad Request\n{\n    \"state\": false,\n    \"code\": 1000,\n    \"message\": \"传入参数不正确\",\n    \"data\": null or []\n}\n可能出现的错误代码:\n   1000    CLIENT_WRONG_PARAMS             传入参数不正确",
+          "type": "json"
+        }
+      ]
+    },
+    "filename": "app/Http/Controllers/Api/V1/AlbumBossController.php",
+    "groupTitle": "Boss",
+    "name": "PostApiAlbum_bossAgent_statistical"
+  },
   {
     "type": "get",
     "url": "/api/car/delete",

+ 555 - 1
public/apidoc/api_data.json

xqd xqd xqd
@@ -1175,7 +1175,7 @@
             "group": "Parameter",
             "type": "int",
             "optional": true,
-            "field": "style_id",
+            "field": "parent_id",
             "description": ""
           }
         ]
@@ -1231,6 +1231,13 @@
             "optional": true,
             "field": "open_id",
             "description": ""
+          },
+          {
+            "group": "Parameter",
+            "type": "int",
+            "optional": true,
+            "field": "parent_id",
+            "description": ""
           }
         ]
       }
@@ -2041,6 +2048,553 @@
     "groupTitle": "Auth",
     "name": "PostApiAuthLogin"
   },
+  {
+    "type": "get",
+    "url": "/api/album_boss/get_top",
+    "title": "经销商排行榜(get_top)",
+    "description": "<p>经销商排行榜(get_top)</p>",
+    "group": "Boss",
+    "permission": [
+      {
+        "name": "none"
+      }
+    ],
+    "version": "0.1.0",
+    "parameter": {
+      "fields": {
+        "Parameter": [
+          {
+            "group": "Parameter",
+            "type": "int",
+            "optional": true,
+            "field": "store_id",
+            "description": "<p>商户id</p>"
+          }
+        ]
+      }
+    },
+    "success": {
+      "examples": [
+        {
+          "title": "Success-Response:",
+          "content": "HTTP/1.1 200 OK\n{\n    \"status\": true,\n    \"status_code\": 0,\n    \"message\": \"\",\n    \"data\": {\n        \"agent\": [\n             {\n                 \"id\": 3,\n                 \"avatar\": \"http://admin.xcx.com/upload/images/20180519/02f2dbe0e1046d7cea8b3b52d5642fb8.jpg\",\n                 \"name\": \"张三\",\n                 \"get_count\": \"客户数量\",\n             }\n         ],\n    }\n}",
+          "type": "json"
+        }
+      ]
+    },
+    "error": {
+      "examples": [
+        {
+          "title": "Error-Response:",
+          "content": "HTTP/1.1 400 Bad Request\n{\n    \"state\": false,\n    \"code\": 1000,\n    \"message\": \"传入参数不正确\",\n    \"data\": null or []\n}\n可能出现的错误代码:\n   1000    CLIENT_WRONG_PARAMS             传入参数不正确",
+          "type": "json"
+        }
+      ]
+    },
+    "filename": "app/Http/Controllers/Api/V1/AlbumBossController.php",
+    "groupTitle": "Boss",
+    "name": "GetApiAlbum_bossGet_top"
+  },
+  {
+    "type": "post",
+    "url": "/api/album_boss/agent_analysis",
+    "title": "经销商分析(agent_analysis)",
+    "description": "<p>经销商分析(agent_analysis)</p>",
+    "group": "Boss",
+    "permission": [
+      {
+        "name": "none"
+      }
+    ],
+    "version": "0.1.0",
+    "parameter": {
+      "fields": {
+        "Parameter": [
+          {
+            "group": "Parameter",
+            "type": "int",
+            "optional": true,
+            "field": "store_id",
+            "description": "<p>商户id</p>"
+          }
+        ]
+      }
+    },
+    "success": {
+      "examples": [
+        {
+          "title": "Success-Response:",
+          "content": "HTTP/1.1 200 OK\n{\n    \"status\": true,\n    \"status_code\": 0,\n    \"message\": \"\",\n    \"data\": [\n        {\n            \"realname\" : 释迦摩尼,\n            \"pointCount\" : 111\n            \"callCount\" : 111\n            \"favoriteCount\" : 111\n            \"get_count\" : 111\n            \"share_times\" : 111\n            \"newCount\" : 111\n        }\n    ]\n}",
+          "type": "json"
+        }
+      ]
+    },
+    "error": {
+      "examples": [
+        {
+          "title": "Error-Response:",
+          "content": "HTTP/1.1 400 Bad Request\n{\n    \"state\": false,\n    \"code\": 1000,\n    \"message\": \"传入参数不正确\",\n    \"data\": null or []\n}\n可能出现的错误代码:\n   1000    CLIENT_WRONG_PARAMS             传入参数不正确",
+          "type": "json"
+        }
+      ]
+    },
+    "filename": "app/Http/Controllers/Api/V1/AlbumBossController.php",
+    "groupTitle": "Boss",
+    "name": "PostApiAlbum_bossAgent_analysis"
+  },
+  {
+    "type": "post",
+    "url": "/api/album_boss/agent_customer",
+    "title": "经销商客户(agent_customer)",
+    "description": "<p>经销商客户(agent_customer)</p>",
+    "group": "Boss",
+    "permission": [
+      {
+        "name": "none"
+      }
+    ],
+    "version": "0.1.0",
+    "parameter": {
+      "fields": {
+        "Parameter": [
+          {
+            "group": "Parameter",
+            "type": "int",
+            "optional": true,
+            "field": "store_id",
+            "description": "<p>商户id</p>"
+          },
+          {
+            "group": "Parameter",
+            "type": "int",
+            "optional": true,
+            "field": "agent_id",
+            "description": "<p>经销商id</p>"
+          }
+        ]
+      }
+    },
+    "success": {
+      "examples": [
+        {
+          "title": "Success-Response:",
+          "content": "HTTP/1.1 200 OK\n{\n    \"status\": true,\n    \"status_code\": 0,\n    \"message\": \"\",\n    \"data\": {\n        \"agent\": [\n             {\n                 \"id\": 3,\n                 \"avatar\": \"http://admin.xcx.com/upload/images/20180519/02f2dbe0e1046d7cea8b3b52d5642fb8.jpg\",\n                 \"name\": \"张三\",\n                 \"address\": \"四川省\",\n                 \"phone\": \"8208208820\",\n                 \"lon\": \"100.123123\",\n                 \"lat\": \"123.123123\",\n             }\n         ],\n        \"customer\": [\n             {\n                 \"id\": 3,\n                 \"avatar\": \"http://admin.xcx.com/upload/images/20180519/02f2dbe0e1046d7cea8b3b52d5642fb8.jpg\",\n                 \"name\": \"张三\",\n                 \"address\": \"四川省甘肃市\"\n              }\n         ]\n    }\n}",
+          "type": "json"
+        }
+      ]
+    },
+    "error": {
+      "examples": [
+        {
+          "title": "Error-Response:",
+          "content": "HTTP/1.1 400 Bad Request\n{\n    \"state\": false,\n    \"code\": 1000,\n    \"message\": \"传入参数不正确\",\n    \"data\": null or []\n}\n可能出现的错误代码:\n   1000    CLIENT_WRONG_PARAMS             传入参数不正确",
+          "type": "json"
+        }
+      ]
+    },
+    "filename": "app/Http/Controllers/Api/V1/AlbumBossController.php",
+    "groupTitle": "Boss",
+    "name": "PostApiAlbum_bossAgent_customer"
+  },
+  {
+    "type": "post",
+    "url": "/api/album_boss/agent_overview_active",
+    "title": "经销商总览活跃客户(agent_overview_active)",
+    "description": "<p>经销商总览活跃客户(agent_overview_active)</p>",
+    "group": "Boss",
+    "permission": [
+      {
+        "name": "none"
+      }
+    ],
+    "version": "0.1.0",
+    "parameter": {
+      "fields": {
+        "Parameter": [
+          {
+            "group": "Parameter",
+            "type": "int",
+            "optional": true,
+            "field": "store_id",
+            "description": "<p>商户id</p>"
+          }
+        ]
+      }
+    },
+    "success": {
+      "examples": [
+        {
+          "title": "Success-Response:",
+          "content": "HTTP/1.1 200 OK\n{\n    \"status\": true,\n    \"status_code\": 0,\n    \"message\": \"\",\n    \"data\": {\n        \"activeCustomers\": [\n             {\n                 \"day\" : 03/25,\n                 \"num\" : 111\n             }\n         ],\n    }\n}",
+          "type": "json"
+        }
+      ]
+    },
+    "error": {
+      "examples": [
+        {
+          "title": "Error-Response:",
+          "content": "HTTP/1.1 400 Bad Request\n{\n    \"state\": false,\n    \"code\": 1000,\n    \"message\": \"传入参数不正确\",\n    \"data\": null or []\n}\n可能出现的错误代码:\n   1000    CLIENT_WRONG_PARAMS             传入参数不正确",
+          "type": "json"
+        }
+      ]
+    },
+    "filename": "app/Http/Controllers/Api/V1/AlbumBossController.php",
+    "groupTitle": "Boss",
+    "name": "PostApiAlbum_bossAgent_overview_active"
+  },
+  {
+    "type": "post",
+    "url": "/api/album_boss/agent_overview_call",
+    "title": "经销商总览咨询(agent_overview_call)",
+    "description": "<p>经销商总览咨询(agent_overview_call)</p>",
+    "group": "Boss",
+    "permission": [
+      {
+        "name": "none"
+      }
+    ],
+    "version": "0.1.0",
+    "parameter": {
+      "fields": {
+        "Parameter": [
+          {
+            "group": "Parameter",
+            "type": "int",
+            "optional": true,
+            "field": "store_id",
+            "description": "<p>商户id</p>"
+          },
+          {
+            "group": "Parameter",
+            "type": "int",
+            "optional": true,
+            "field": "day",
+            "description": "<p>天数</p>"
+          }
+        ]
+      }
+    },
+    "success": {
+      "examples": [
+        {
+          "title": "Success-Response:",
+          "content": "HTTP/1.1 200 OK\n{\n    \"status\": true,\n    \"status_code\": 0,\n    \"message\": \"\",\n    \"data\": {\n         \"callCustomers\": [\n             {\n                 \"day\" : 03/25,\n                 \"num\" : 111\n             }\n         ]\n    }\n}",
+          "type": "json"
+        }
+      ]
+    },
+    "error": {
+      "examples": [
+        {
+          "title": "Error-Response:",
+          "content": "HTTP/1.1 400 Bad Request\n{\n    \"state\": false,\n    \"code\": 1000,\n    \"message\": \"传入参数不正确\",\n    \"data\": null or []\n}\n可能出现的错误代码:\n   1000    CLIENT_WRONG_PARAMS             传入参数不正确",
+          "type": "json"
+        }
+      ]
+    },
+    "filename": "app/Http/Controllers/Api/V1/AlbumBossController.php",
+    "groupTitle": "Boss",
+    "name": "PostApiAlbum_bossAgent_overview_call"
+  },
+  {
+    "type": "post",
+    "url": "/api/album_boss/agent_overview_favorite",
+    "title": "经销商总览兴趣占比(agent_overview_favorite)",
+    "description": "<p>经销商总览兴趣占比(agent_overview_favorite)</p>",
+    "group": "Boss",
+    "permission": [
+      {
+        "name": "none"
+      }
+    ],
+    "version": "0.1.0",
+    "parameter": {
+      "fields": {
+        "Parameter": [
+          {
+            "group": "Parameter",
+            "type": "int",
+            "optional": true,
+            "field": "store_id",
+            "description": "<p>商户id</p>"
+          },
+          {
+            "group": "Parameter",
+            "type": "int",
+            "optional": true,
+            "field": "parent_id",
+            "description": "<p>商户id</p>"
+          },
+          {
+            "group": "Parameter",
+            "type": "int",
+            "optional": true,
+            "field": "start",
+            "description": "<p>开始时间</p>"
+          },
+          {
+            "group": "Parameter",
+            "type": "int",
+            "optional": true,
+            "field": "end",
+            "description": "<p>结束时间</p>"
+          }
+        ]
+      }
+    },
+    "success": {
+      "examples": [
+        {
+          "title": "Success-Response:",
+          "content": "HTTP/1.1 200 OK\n{\n    \"status\": true,\n    \"status_code\": 0,\n    \"message\": \"\",\n    \"data\": {\n         \"arrFavorite\": [\n             {\n                 'name':'asdawd',\n                 'point':'asdawd',\n                 'num':'1',\n             }\n         ]\n    }\n}",
+          "type": "json"
+        }
+      ]
+    },
+    "error": {
+      "examples": [
+        {
+          "title": "Error-Response:",
+          "content": "HTTP/1.1 400 Bad Request\n{\n    \"state\": false,\n    \"code\": 1000,\n    \"message\": \"传入参数不正确\",\n    \"data\": null or []\n}\n可能出现的错误代码:\n   1000    CLIENT_WRONG_PARAMS             传入参数不正确",
+          "type": "json"
+        }
+      ]
+    },
+    "filename": "app/Http/Controllers/Api/V1/AlbumBossController.php",
+    "groupTitle": "Boss",
+    "name": "PostApiAlbum_bossAgent_overview_favorite"
+  },
+  {
+    "type": "post",
+    "url": "/api/album_boss/agent_overview_funnel",
+    "title": "经销商总览漏斗(agent_overview_funnel)",
+    "description": "<p>经销商总览漏斗(agent_overview_funnel)</p>",
+    "group": "Boss",
+    "permission": [
+      {
+        "name": "none"
+      }
+    ],
+    "version": "0.1.0",
+    "parameter": {
+      "fields": {
+        "Parameter": [
+          {
+            "group": "Parameter",
+            "type": "int",
+            "optional": true,
+            "field": "store_id",
+            "description": "<p>商户id</p>"
+          }
+        ]
+      }
+    },
+    "success": {
+      "examples": [
+        {
+          "title": "Success-Response:",
+          "content": "HTTP/1.1 200 OK\n{\n    \"status\": true,\n    \"status_code\": 0,\n    \"message\": \"\",\n    \"data\": {\n        \"customerFollow\":11,\n        \"shareCount\":11,\n        \"totalCustomerCount\":11,\n    }\n}",
+          "type": "json"
+        }
+      ]
+    },
+    "error": {
+      "examples": [
+        {
+          "title": "Error-Response:",
+          "content": "HTTP/1.1 400 Bad Request\n{\n    \"state\": false,\n    \"code\": 1000,\n    \"message\": \"传入参数不正确\",\n    \"data\": null or []\n}\n可能出现的错误代码:\n   1000    CLIENT_WRONG_PARAMS             传入参数不正确",
+          "type": "json"
+        }
+      ]
+    },
+    "filename": "app/Http/Controllers/Api/V1/AlbumBossController.php",
+    "groupTitle": "Boss",
+    "name": "PostApiAlbum_bossAgent_overview_funnel"
+  },
+  {
+    "type": "post",
+    "url": "/api/album_boss/agent_overview_left",
+    "title": "经销商总览左侧(agent_overview_left)",
+    "description": "<p>经销商总览左侧(agent_overview_left)</p>",
+    "group": "Boss",
+    "permission": [
+      {
+        "name": "none"
+      }
+    ],
+    "version": "0.1.0",
+    "parameter": {
+      "fields": {
+        "Parameter": [
+          {
+            "group": "Parameter",
+            "type": "int",
+            "optional": true,
+            "field": "store_id",
+            "description": "<p>商户id</p>"
+          },
+          {
+            "group": "Parameter",
+            "type": "int",
+            "optional": true,
+            "field": "start",
+            "description": "<p>开始时间</p>"
+          },
+          {
+            "group": "Parameter",
+            "type": "int",
+            "optional": true,
+            "field": "end",
+            "description": "<p>结束时间</p>"
+          }
+        ]
+      }
+    },
+    "success": {
+      "examples": [
+        {
+          "title": "Success-Response:",
+          "content": "HTTP/1.1 200 OK\n{\n    \"status\": true,\n    \"status_code\": 0,\n    \"message\": \"\",\n    \"data\": {\n        \"customerFollow\":11,\n        \"downloadCount\":11,\n        \"shareCount\":11,\n        \"newCustomerCount\":11,\n        \"totalCustomerCount\":11,\n    }\n}",
+          "type": "json"
+        }
+      ]
+    },
+    "error": {
+      "examples": [
+        {
+          "title": "Error-Response:",
+          "content": "HTTP/1.1 400 Bad Request\n{\n    \"state\": false,\n    \"code\": 1000,\n    \"message\": \"传入参数不正确\",\n    \"data\": null or []\n}\n可能出现的错误代码:\n   1000    CLIENT_WRONG_PARAMS             传入参数不正确",
+          "type": "json"
+        }
+      ]
+    },
+    "filename": "app/Http/Controllers/Api/V1/AlbumBossController.php",
+    "groupTitle": "Boss",
+    "name": "PostApiAlbum_bossAgent_overview_left"
+  },
+  {
+    "type": "post",
+    "url": "/api/album_boss/agent_overview_new",
+    "title": "经销商总览新增客户(agent_overview_new)",
+    "description": "<p>经销商总览新增客户(agent_overview_new)</p>",
+    "group": "Boss",
+    "permission": [
+      {
+        "name": "none"
+      }
+    ],
+    "version": "0.1.0",
+    "parameter": {
+      "fields": {
+        "Parameter": [
+          {
+            "group": "Parameter",
+            "type": "int",
+            "optional": true,
+            "field": "store_id",
+            "description": "<p>商户id</p>"
+          },
+          {
+            "group": "Parameter",
+            "type": "int",
+            "optional": true,
+            "field": "day",
+            "description": "<p>天数</p>"
+          }
+        ]
+      }
+    },
+    "success": {
+      "examples": [
+        {
+          "title": "Success-Response:",
+          "content": "HTTP/1.1 200 OK\n{\n    \"status\": true,\n    \"status_code\": 0,\n    \"message\": \"\",\n    \"data\": {\n         \"newCustomers\": [\n             {\n                 \"day\" : 03/25,\n                 \"num\" : 111\n             }\n         ]\n    }\n}",
+          "type": "json"
+        }
+      ]
+    },
+    "error": {
+      "examples": [
+        {
+          "title": "Error-Response:",
+          "content": "HTTP/1.1 400 Bad Request\n{\n    \"state\": false,\n    \"code\": 1000,\n    \"message\": \"传入参数不正确\",\n    \"data\": null or []\n}\n可能出现的错误代码:\n   1000    CLIENT_WRONG_PARAMS             传入参数不正确",
+          "type": "json"
+        }
+      ]
+    },
+    "filename": "app/Http/Controllers/Api/V1/AlbumBossController.php",
+    "groupTitle": "Boss",
+    "name": "PostApiAlbum_bossAgent_overview_new"
+  },
+  {
+    "type": "post",
+    "url": "/api/album_boss/agent_statistical",
+    "title": "经销商数据(agent_statistical)",
+    "description": "<p>经销商数据(agent_statistical)</p>",
+    "group": "Boss",
+    "permission": [
+      {
+        "name": "none"
+      }
+    ],
+    "version": "0.1.0",
+    "parameter": {
+      "fields": {
+        "Parameter": [
+          {
+            "group": "Parameter",
+            "type": "int",
+            "optional": true,
+            "field": "store_id",
+            "description": "<p>商户id</p>"
+          },
+          {
+            "group": "Parameter",
+            "type": "int",
+            "optional": true,
+            "field": "agent_id",
+            "description": "<p>经销商id</p>"
+          },
+          {
+            "group": "Parameter",
+            "type": "int",
+            "optional": true,
+            "field": "start",
+            "description": "<p>开始时间</p>"
+          },
+          {
+            "group": "Parameter",
+            "type": "int",
+            "optional": true,
+            "field": "end",
+            "description": "<p>结束时间</p>"
+          }
+        ]
+      }
+    },
+    "success": {
+      "examples": [
+        {
+          "title": "Success-Response:",
+          "content": "HTTP/1.1 200 OK\n{\n    \"status\": true,\n    \"status_code\": 0,\n    \"message\": \"\",\n    \"data\": {\n        \"favoriteCount\":11,\n        \"downloadCount\":11,\n        \"shareCount\":11,\n        \"newCustomerCount\":11,\n        \"totalCustomerCount\":11,\n    }\n}",
+          "type": "json"
+        }
+      ]
+    },
+    "error": {
+      "examples": [
+        {
+          "title": "Error-Response:",
+          "content": "HTTP/1.1 400 Bad Request\n{\n    \"state\": false,\n    \"code\": 1000,\n    \"message\": \"传入参数不正确\",\n    \"data\": null or []\n}\n可能出现的错误代码:\n   1000    CLIENT_WRONG_PARAMS             传入参数不正确",
+          "type": "json"
+        }
+      ]
+    },
+    "filename": "app/Http/Controllers/Api/V1/AlbumBossController.php",
+    "groupTitle": "Boss",
+    "name": "PostApiAlbum_bossAgent_statistical"
+  },
   {
     "type": "get",
     "url": "/api/car/delete",

+ 1 - 1
public/apidoc/api_project.js

xqd
@@ -9,7 +9,7 @@ define({
   "apidoc": "0.3.0",
   "generator": {
     "name": "apidoc",
-    "time": "2019-03-28T09:03:36.904Z",
+    "time": "2019-04-17T06:56:10.150Z",
     "url": "http://apidocjs.com",
     "version": "0.17.6"
   }

+ 1 - 1
public/apidoc/api_project.json

xqd
@@ -9,7 +9,7 @@
   "apidoc": "0.3.0",
   "generator": {
     "name": "apidoc",
-    "time": "2019-03-28T09:03:36.904Z",
+    "time": "2019-04-17T06:56:10.150Z",
     "url": "http://apidocjs.com",
     "version": "0.17.6"
   }

+ 15 - 31
resources/views/admin/album/agent/index.blade.php

xqd xqd
@@ -37,7 +37,7 @@
     						<tr>
 								
             <th class="sorting" data-sort="id"> ID </th>
-            <th class="sorting" data-sort="user_id"> 用户ID </th>
+            <th> 微信昵称 </th>
             <th class="sorting" data-sort="user_id"> 电话 </th>
             <th class="sorting" data-sort="address"> 地址 </th>
             <th class="sorting" data-sort="name"> 名称 </th>
@@ -50,42 +50,26 @@
 							@foreach($list as $key => $item)							<tr>
 								
             <td>{{ $item->id }}</td>
-            <td>{{ $item->user_id }}</td>
+            <td>{{ $item->nickname }}</td>
             <td>{{ $item->phone }}</td>
             <td>{{ $item->address }}</td>
             <td>{{ $item->name }}</td>
             <td>{{ $item->status }}</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('Album/Agent/update'))
-											<li><a href="{{ U('Album/Agent/update',['id'=>$item->id])}}" class="font-bold">修改</a></li>
-											@endif
-
-											@if($item->status == '待审核')
-												<li><a href="{{ U('Album/Agent/status',['id'=>$item->id,'status'=>1])}}" class="font-bold">通过审核</a></li>
-											@endif
-
-											@if(role('Album/Agent/destroy'))
-											<li class="divider"></li>
-											<li><a href="{{ U('Album/Agent/destroy',['id'=>$item->id])}}" onclick="return confirm('你确定执行删除操作?');">删除</a></li>
-											@endif
-
-										</ul>
+									<div class="pull-left">
+										@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($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
+										@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/Agent/view'))
+												<a href="{{ U('Album/Product/Price/index',['id'=>$item->id])}}" class="btn btn-sm btn-primary pull-right">查看报价</a>
+										@endif
 									</div>
-								@if(role('Album/Agent/view'))
-
-										<div class="col-sm-3 pull-right">
-											<a href="{{ U('Album/Product/Price/index',['id'=>$item->id])}}" class="btn btn-sm btn-primary pull-right">查看报价</a>
-										</div>
-									@endif
 								</td>
 							</tr>
 							@endforeach

+ 8 - 22
resources/views/admin/album/banner/index.blade.php

xqd xqd
@@ -18,7 +18,7 @@
 
                                 <div class="col-sm-4">
                                     <div class="input-group">
-                                        <input type="text" value="{{Request::get('keyword')}}" placeholder="请输入关键词"
+                                        <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>
@@ -59,27 +59,13 @@
                                         <td>{{ $item->sort }}</td>
                                         <td>{{ $item->created_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('Album/Banner/update'))
-                                                        <li><a href="{{ U('Album/Banner/update',['id'=>$item->id])}}"
-                                                               class="font-bold">修改</a></li>
-                                                    @endif
-
-                                                    @if(role('Album/Banner/destroy'))
-                                                        <li class="divider"></li>
-                                                        <li><a href="{{ U('Album/Banner/destroy',['id'=>$item->id])}}"
-                                                               onclick="return confirm('你确定执行删除操作?');">删除</a></li>
-                                                    @endif
-
-                                                </ul>
+                                            <div class="pull-left">
+                                                @if(role('Album/Banner/update'))
+                                                    <a href="{{ U('Album/Banner/update',['id'=>$item->id])}}" class="btn btn-sm btn-warning pull-right">修改</a>
+                                                @endif
+                                                @if(role('Album/Banner/destroy'))
+                                                    <a href="{{ U('Album/Banner/destroy',['id'=>$item->id])}}" onclick="return confirm('你确定执行删除操作?');" class="btn btn-sm btn-danger pull-right">删除</a>
+                                                @endif
                                             </div>
                                             @if(role('Album/Banner/view'))
                                                 <button onclick="layer.open({type: 2,area: ['80%', '90%'],content: '{{ U('Album/Banner/view',['id'=>$item->id])}}'});"

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

xqd
@@ -10,31 +10,31 @@
     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="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">
 

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

xqd
@@ -2,131 +2,131 @@
 
 @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">
+<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/Cat/create'))
-                                <div class="col-sm-3 pull-right">
-                                    <a href="{{ U('Album/Cat/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>
+    						</div>
+				        </div>
+				        </form>
+						@if(role('Album/Cat/create'))
+    					<div class="col-sm-3 pull-right">
+    					   <a href="{{ U('Album/Cat/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" width="15%"> ID </th>
+            <th class="sorting" data-sort="name" width="20%"> 名称 </th>
+            <th class="sorting" data-sort="sort" width="10%"> 排序 </th>
+            <th class="sorting" data-sort="pic_url" width="15%"> 分类图标 </th>
+            <th class="sorting" data-sort="created_at" width="18%"> 添加时间 </th>
+        						<th width="22%">相关操作</th>
+        					</tr>
+						</thead>
+						<tbody>
+							@if(isset($list))
+							@foreach($list as $key => $item)
+								<tr style="background-color: white;">
+									<td>{{ $item->id }}</td>
+									<td>{{ $item->name }}</td>
+									<td>{{ $item->sort }}</td>
+									<td><img src="{{ $item->pic_url }}" width="50"/></td>
+									<td>{{ $item->created_at }}</td>
+									<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>
+											@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>
+											@endif
+											@if(count($item->sonlist) > 0)
+												<a id="a{{ $item->id }}" onclick="showHidden({{ $item->id }})" class="btn btn-sm btn-default pull-right">查看</a>
+											@endif
+										</div>
+									{{--@if(role('Album/Cat/view'))
+											<button onclick="layer.open({type: 2,area: ['80%', '90%'],content: '{{ U('Album/Cat/view',['id'=>$item->id])}}'});"  class="btn btn-primary ">查看</button>
+										@endif--}}
+									</td>
+								</tr>
+								@if(isset($item->sonlist))
+									@foreach($item->sonlist as $k => $t)
+											<tr style="background-color: #f9f9f9;display: none" class="son{{ $item->id }}">
+												<td>{{ $t->id }}</td>
+												<td>{{ $t->name }}</td>
+												<td>{{ $t->level }}</td>
+												<td>{{ $t->sort }}</td>
+												<td><img src="{{ $t->pic_url }}" width="50"/></td>
+												<td>{{ $t->created_at }}</td>
+												<td>
+													<div class="pull-left">
+														@if(role('Album/Cat/update'))
+															<a href="{{ U('Album/Cat/update',['id'=>$t->id])}}" class="btn btn-sm btn-warning pull-right">修改</a>
+														@endif
+														@if(role('Album/Cat/destroy'))
+															<a href="{{ U('Album/Cat/destroy',['id'=>$t->id])}}" onclick="return confirm('你确定执行删除操作?');" class="btn btn-sm btn-danger pull-right">删除</a>
+														@endif
+													</div>
+												</td>
+											</tr>
+									@endforeach
+									@endif
+							@endforeach
+							@endif
 
-                                <th class="sorting" data-sort="id" width="10%"> ID </th>
-                                <th class="sorting" data-sort="name" width="20%"> 名称 </th>
-                                <th class="sorting" data-sort="level" width="10%"> 分类级别 </th>
-                                <th class="sorting" data-sort="sort" width="10%"> 排序 </th>
-                                <th class="sorting" data-sort="pic_url" width="10%"> 分类图标 </th>
-                                <th class="sorting" data-sort="created_at" width="18%"> 添加时间 </th>
-                                <th width="22%">相关操作</th>
-                            </tr>
-                            </thead>
-                            <tbody>
-                            @if(isset($list))
-                                @foreach($list as $key => $item)
-                                    <tr style="background-color: white;">
-                                        <td>{{ $item->id }}</td>
-                                        <td>{{ $item->name }}</td>
-                                        <td>{{ $item->level }}</td>
-                                        <td>{{ $item->sort }}</td>
-                                        <td><img src="{{ $item->pic_url }}" width="50"/></td>
-                                        <td>{{ $item->created_at }}</td>
-                                        <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>
-                                                @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>
-                                                @endif
-                                                @if(count($item->sonlist) > 0)
-                                                    <a id="a{{ $item->id }}" onclick="showHidden({{ $item->id }})" class="btn btn-sm btn-default pull-right">查看</a>
-                                                @endif
-                                            </div>
-                                            {{--@if(role('Album/Cat/view'))
-                                                    <button onclick="layer.open({type: 2,area: ['80%', '90%'],content: '{{ U('Album/Cat/view',['id'=>$item->id])}}'});"  class="btn btn-primary ">查看</button>
-                                                @endif--}}
-                                        </td>
-                                    </tr>
-                                    @if(isset($item->sonlist))
-                                        @foreach($item->sonlist as $k => $t)
-                                                <tr style="background-color: #f9f9f9;display: none" id="son{{ $item->id }}">
-                                                    <td>{{ $t->id }}</td>
-                                                    <td>{{ $t->name }}</td>
-                                                    <td>{{ $t->level }}</td>
-                                                    <td>{{ $t->sort }}</td>
-                                                    <td><img src="{{ $t->pic_url }}" width="50"/></td>
-                                                    <td>{{ $t->created_at }}</td>
-                                                    <td>
-                                                        <div class="pull-left">
-                                                            @if(role('Album/Cat/update'))
-                                                                <a href="{{ U('Album/Cat/update',['id'=>$t->id])}}" class="btn btn-sm btn-warning pull-right">修改</a>
-                                                            @endif
-                                                            @if(role('Album/Cat/destroy'))
-                                                                <a href="{{ U('Album/Cat/destroy',['id'=>$t->id])}}" onclick="return confirm('你确定执行删除操作?');" class="btn btn-sm btn-danger pull-right">删除</a>
-                                                            @endif
-                                                        </div>
-                                                    </td>
-                                                </tr>
-                                        @endforeach
-                                    @endif
-                                @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>
 
-                            </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>
+<script>
+	function showHidden(id){
+		var text = $("#a"+id).text();
+		if (text == '查看') {
+            $("#a"+id).text('隐藏');
+		} else {
+            $("#a"+id).text('查看');
+		}
 
-    <script>
-        function showHidden(id){
-            var text = $("#a"+id).text();
-            if (text == '查看') {
-                $("#a"+id).text('隐藏');
-            } else {
-                $("#a"+id).text('查看');
-            }
+		$(".son"+id).slideToggle(1000);
+	}
+</script>
 
-            $("#son"+id).slideToggle(1000);
-        }
-    </script>
 @endsection

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

xqd
@@ -25,14 +25,7 @@
                                                    
                    <p class="list-group-item-text"> {{ $data['parent_id'] or ''}}</p>
                                                  
-               </div>                     
-               <div class="list-group-item">
-                                                  
-                   <h3 class="list-group-item-heading">分类级别</h3>
-                                                   
-                   <p class="list-group-item-text"> {{ $data['level'] or ''}}</p>
-                                                 
-               </div>                     
+               </div>
                <div class="list-group-item">
                                                   
                    <h3 class="list-group-item-heading">图片url</h3>

+ 8 - 22
resources/views/admin/album/comments/index.blade.php

xqd xqd
@@ -18,7 +18,7 @@
 
                                 <div class="col-sm-4">
                                     <div class="input-group">
-                                        <input type="text" value="{{Request::get('keyword')}}" placeholder="请输入关键词"
+                                        <input type="text" value="{{Request::get('keyword')}}" placeholder="请输入ID/标题/用户ID/内容"
                                                name="keyword" class="input-sm form-control">
                                         <span class="input-group-btn">
 									<button type="submit" class="btn btn-sm btn-primary">搜索</button>
@@ -58,27 +58,13 @@
                                         <td style="overflow: hidden;">{{ $item->content }}</td>
                                         <td style="overflow: hidden;">{{ $item->sys_reply }}</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('Album/Comments/update'))
-                                                        <li><a href="{{ U('Album/Comments/update',['id'=>$item->id])}}"
-                                                               class="font-bold">回复</a></li>
-                                                    @endif
-
-                                                    @if(role('Album/Comments/destroy'))
-                                                        <li class="divider"></li>
-                                                        <li><a href="{{ U('Album/Comments/destroy',['id'=>$item->id])}}"
-                                                               onclick="return confirm('你确定执行删除操作?');">删除</a></li>
-                                                    @endif
-
-                                                </ul>
+                                            <div class="pull-left">
+                                                @if(role('Album/Comments/update'))
+                                                    <a href="{{ U('Album/Comments/update',['id'=>$item->id])}}" class="btn btn-sm btn-warning pull-right">修改</a>
+                                                @endif
+                                                @if(role('Album/Comments/destroy'))
+                                                    <a href="{{ U('Album/Comments/destroy',['id'=>$item->id])}}" onclick="return confirm('你确定执行删除操作?');" class="btn btn-sm btn-danger pull-right">删除</a>
+                                                @endif
                                             </div>
                                             @if(role('Album/Comments/view'))
                                                 <button onclick="layer.open({type: 2,area: ['80%', '90%'],content: '{{ U('Album/Comments/view',['id'=>$item->id])}}'});"

+ 5 - 17
resources/views/admin/album/info/cat/index.blade.php

xqd xqd
@@ -18,7 +18,7 @@
 
 				        <div class="col-sm-4">
 				            <div class="input-group">
-								<input type="text" value="{{Request::get('keyword')}}"	placeholder="请输入关键词" name="keyword"class="input-sm form-control"> 
+								<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>
@@ -49,26 +49,14 @@
             <td>{{ $item->name }}</td>
 								<td>
 									@if($item->id != 1)
-									<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">
-
-
+										<div class="pull-left">
 											@if(role('Album/Info/Cat/update'))
-											<li><a href="{{ U('Album/Info/Cat/update',['id'=>$item->id])}}" class="font-bold">修改</a></li>
+												<a href="{{ U('Album/Info/Cat/update',['id'=>$item->id])}}" class="btn btn-sm btn-warning pull-right">修改</a>
 											@endif
-
 											@if(role('Album/Info/Cat/destroy'))
-											<li class="divider"></li>
-											<li><a href="{{ U('Album/Info/Cat/destroy',['id'=>$item->id])}}" onclick="return confirm('你确定执行删除操作?');">删除</a></li>
+												<a href="{{ U('Album/Info/Cat/destroy',['id'=>$item->id])}}" onclick="return confirm('你确定执行删除操作?');" class="btn btn-sm btn-danger pull-right">删除</a>
 											@endif
-
-										</ul>
-									</div>
+										</div>
 								{{--@if(role('Album/Info/Cat/view'))
 										<button onclick="layer.open({type: 2,area: ['80%', '90%'],content: '{{ U('Album/Info/Cat/view',['id'=>$item->id])}}'});"  class="btn btn-primary ">查看</button>
 									@endif--}}

+ 8 - 24
resources/views/admin/album/information/index.blade.php

xqd xqd
@@ -18,7 +18,7 @@
 
                                 <div class="col-sm-4">
                                     <div class="input-group">
-                                        <input type="text" value="{{Request::get('keyword')}}" placeholder="请输入关键词"
+                                        <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>
@@ -59,29 +59,13 @@
                                         <td><img style="width: 50px" src="{{ $item->thumb }}" alt=""></td>
                                         <td>{{ $item->created_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('Album/Information/update'))
-                                                        <li>
-                                                            <a href="{{ U('Album/Information/update',['id'=>$item->id])}}"
-                                                               class="font-bold">修改</a></li>
-                                                    @endif
-
-                                                    @if(role('Album/Information/destroy'))
-                                                        <li class="divider"></li>
-                                                        <li>
-                                                            <a href="{{ U('Album/Information/destroy',['id'=>$item->id])}}"
-                                                               onclick="return confirm('你确定执行删除操作?');">删除</a></li>
-                                                    @endif
-
-                                                </ul>
+                                            <div class="pull-left">
+                                                @if(role('Album/Information/update'))
+                                                    <a href="{{ U('Album/Information/update',['id'=>$item->id])}}" class="btn btn-sm btn-warning pull-right">修改</a>
+                                                @endif
+                                                @if(role('Album/Information/destroy'))
+                                                    <a href="{{ U('Album/Information/destroy',['id'=>$item->id])}}" onclick="return confirm('你确定执行删除操作?');" class="btn btn-sm btn-danger pull-right">删除</a>
+                                                @endif
                                             </div>
                                             @if(role('Album/Information/view'))
                                                 <button onclick="layer.open({type: 2,area: ['80%', '90%'],content: '{{ U('Album/Information/view',['id'=>$item->id])}}'});"

+ 10 - 14
resources/views/admin/album/manufacturer/index.blade.php

xqd xqd
@@ -18,7 +18,7 @@
 
                                 <div class="col-sm-4">
                                     <div class="input-group">
-                                        <input type="text" value="{{Request::get('keyword')}}" placeholder="请输入关键词"
+                                        <input type="text" value="{{Request::get('keyword')}}" placeholder="请输入ID/商户ID/商户名"
                                                name="keyword" class="input-sm form-control">
                                         <span class="input-group-btn">
 									<button type="submit" class="btn btn-sm btn-primary">搜索</button>
@@ -63,20 +63,16 @@
                                         <td>{{ $item->phone }}</td>
                                         <td>{{ $item->address }}</td>
                                         <td>
-                                            <div class="btn-group">
-                                                <button onclick="window.open('{{ U('/Base/Index/welcome',['store_id'=>$item->store_id])}}','_blank')"
-                                                        class="btn btn-warning btn-sm "
-                                                        aria-expanded="false">
-                                                    进入
-                                                </button>
-                                                <ul class="dropdown-menu">
-                                                    @if(role('Album/Manufacturer/destroy'))
-                                                        <li class="divider"></li>
-                                                        <li><a href="{{ U('Album/Manufacturer/destroy',['id'=>$item->id])}}" onclick="return confirm('你确定执行删除操作,该操作将会删除厂家所有数据?');">删除</a></li>
-                                                    @endif
-
-                                                </ul>
+                                            <div class="pull-left">
+                                                @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
                                             </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 ">查看

+ 8 - 22
resources/views/admin/album/nav/index.blade.php

xqd xqd
@@ -18,7 +18,7 @@
 
                                 <div class="col-sm-4">
                                     <div class="input-group">
-                                        <input type="text" value="{{Request::get('keyword')}}" placeholder="请输入关键词"
+                                        <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>
@@ -71,27 +71,13 @@
                                         <td><img src="{{ $item->pic_url }}" width="50"/></td>
                                         <td><img src="{{ $item->pic_url_active }}" width="50"/></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('Album/Nav/update'))
-                                                        <li><a href="{{ U('Album/Nav/update',['id'=>$item->id])}}"
-                                                               class="font-bold">修改</a></li>
-                                                    @endif
-
-                                                    @if(role('Album/Nav/destroy'))
-                                                        <li class="divider"></li>
-                                                        <li><a href="{{ U('Album/Nav/destroy',['id'=>$item->id])}}"
-                                                               onclick="return confirm('你确定执行删除操作?');">删除</a></li>
-                                                    @endif
-
-                                                </ul>
+                                            <div class="pull-left">
+                                                @if(role('Album/Nav/update'))
+                                                    <a href="{{ U('Album/Nav/update',['id'=>$item->id])}}" class="btn btn-sm btn-warning pull-right">修改</a>
+                                                @endif
+                                                @if(role('Album/Nav/destroy'))
+                                                    <a href="{{ U('Album/Nav/destroy',['id'=>$item->id])}}" onclick="return confirm('你确定执行删除操作?');" class="btn btn-sm btn-danger pull-right">删除</a>
+                                                @endif
                                             </div>
                                             {{--@if(role('Album/Nav/view'))
                                                     <button onclick="layer.open({type: 2,area: ['80%', '90%'],content: '{{ U('Album/Nav/view',['id'=>$item->id])}}'});"  class="btn btn-primary ">查看</button>

+ 8 - 22
resources/views/admin/album/news/index.blade.php

xqd xqd
@@ -18,7 +18,7 @@
 
                                 <div class="col-sm-4">
                                     <div class="input-group">
-                                        <input type="text" value="{{Request::get('keyword')}}" placeholder="请输入关键词"
+                                        <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>
@@ -57,27 +57,13 @@
                                         <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('Album/News/update'))
-                                                        <li><a href="{{ U('Album/News/update',['id'=>$item->id])}}"
-                                                               class="font-bold">修改</a></li>
-                                                    @endif
-
-                                                    @if(role('Album/News/destroy'))
-                                                        <li class="divider"></li>
-                                                        <li><a href="{{ U('Album/News/destroy',['id'=>$item->id])}}"
-                                                               onclick="return confirm('你确定执行删除操作?');">删除</a></li>
-                                                    @endif
-
-                                                </ul>
+                                            <div class="pull-left">
+                                                @if(role('Album/News/update'))
+                                                    <a href="{{ U('Album/News/update',['id'=>$item->id])}}" class="btn btn-sm btn-warning pull-right">修改</a>
+                                                @endif
+                                                @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
                                             </div>
                                             @if(role('Album/News/view'))
                                                 <button onclick="layer.open({type: 2,area: ['80%', '90%'],content: '{{ U('Album/News/view',['id'=>$item->id])}}'});"

+ 8 - 25
resources/views/admin/album/product/attr/index.blade.php

xqd xqd
@@ -18,7 +18,7 @@
 
                                 <div class="col-sm-4">
                                     <div class="input-group">
-                                        <input type="text" value="{{Request::get('keyword')}}" placeholder="请输入关键词"
+                                        <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>
@@ -50,36 +50,19 @@
                             @if(isset($list))
                                 @foreach($list as $key => $item)
                                     <tr>
-
                                         <td>{{ $item->id }}</td>
                                         <td>{{ $item->name }}</td>
                                         <td>{{ $item->pid() }}</td>
                                         <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('Album/Product/Attr/update'))
-                                                        <li>
-                                                            <a href="{{ U('Album/Product/Attr/update',['id'=>$item->id])}}"
-                                                               class="font-bold">修改</a></li>
-                                                    @endif
-
-                                                    @if(role('Album/Product/Attr/destroy'))
-                                                        <li class="divider"></li>
-                                                        <li>
-                                                            <a href="{{ U('Album/Product/Attr/destroy',['id'=>$item->id])}}"
-                                                               onclick="return confirm('你确定执行删除操作?');">删除</a></li>
-                                                    @endif
-
-                                                </ul>
+                                            <div class="pull-left">
+                                                @if(role('Album/Product/Attr/update'))
+                                                    <a href="{{ U('Album/Product/Attr/update',['id'=>$item->id])}}" class="btn btn-sm btn-warning pull-right">修改</a>
+                                                @endif
+                                                @if(role('Album/Product/Attr/destroy'))
+                                                    <a href="{{ U('Album/Product/Attr/destroy',['id'=>$item->id])}}" onclick="return confirm('你确定执行删除操作?');" class="btn btn-sm btn-danger pull-right">删除</a>
+                                                @endif
                                             </div>
                                         </td>
                                     </tr>

+ 39 - 24
resources/views/admin/album/product/edit.blade.php

xqd xqd xqd
@@ -10,30 +10,33 @@
     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/Product/index'))
-                            <div class="row">
-                                <div class="col-sm-3 pull-right">
-                                    <a href="{{ U('Album/Product/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" onsubmit="return checkLevel()">
+?>
+<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/Product/index'))
+				    <div class="row">
+    					<div class="col-sm-3 pull-right">
+    					   <a href="{{ U('Album/Product/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" onsubmit="return checkLevel()">
+
+                                <div class="form-group">
 
 
                                     <div class="form-group">
@@ -71,10 +74,21 @@
                                             <input id="data_store_id" name="data[price_default]" type="number" class="form-control" value="{{ $data['price_default'] or ''}}" required="" aria-required="true"  placeholder="">
                                         </div>
                                     </div>
-                                    <div class="form-group">
+
+                                </div>
+                                <div class="form-group">
+
+                 <label class="control-label col-sm-3">尺寸图片(1920*1080)</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)) !!}
+                    </div>
+                </div>
+
 
                                         <label class="control-label col-sm-3">出厂价</label>
 
+
                                         <div class="col-sm-9">
                                             <input id="data_ma_price" name="data[ma_price]" type="number" class="form-control" value="{{ $data['ma_price'] or ''}}" required="" aria-required="true"  placeholder="">
                                         </div>
@@ -174,6 +188,7 @@
                         </div>
                         <!-- /.row -->
                     </div>
+
                 </div>
             </div>
         </div>

+ 8 - 22
resources/views/admin/album/product/index.blade.php

xqd xqd xqd
@@ -18,7 +18,7 @@
 
 				        <div class="col-sm-4">
 				            <div class="input-group">
-								<input type="text" value="{{Request::get('keyword')}}"	placeholder="请输入关键词" name="keyword"class="input-sm form-control"> 
+								<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>
@@ -42,7 +42,6 @@
             <th class="sorting" data-sort="price_default"> 默认价格 </th>
             <th class="sorting" data-sort="specifications_img"> 规格图片 </th>
             <th class="sorting" data-sort="install_img"> 安装图片 </th>
-            <th class="sorting" data-sort="style"> 风格 </th>
             <th class="sorting" data-sort="sort"> 排序 </th>
             <th class="sorting" data-sort="cover_pic"> 封面图片 </th>
         						<th width="22%">相关操作</th>
@@ -58,29 +57,16 @@
             <td>{{ $item->price_default }}</td>
             <td><img src="{{ $item->specifications_img }}" width="50"/></td>
             <td><img src="{{ $item->install_img }}" width="50"/></td>
-            <td>{{ $item->style_name }}</td>
             <td>{{ $item->sort }}</td>
             <td><img src="{{ $item->thumb }}" width="50"/></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('Album/Product/update'))
-											<li><a href="{{ U('Album/Product/update',['id'=>$item->id])}}" class="font-bold">修改</a></li>
-											@endif
-
-											@if(role('Album/Product/destroy'))
-											<li class="divider"></li>
-											<li><a href="{{ U('Album/Product/destroy',['id'=>$item->id])}}" onclick="return confirm('你确定执行删除操作?');">删除</a></li>
-											@endif
-
-										</ul>
+									<div class="pull-left">
+										@if(role('Album/Product/update'))
+											<a href="{{ U('Album/Product/update',['id'=>$item->id])}}" class="btn btn-sm btn-warning pull-right">修改</a>
+										@endif
+										@if(role('Album/Product/destroy'))
+											<a href="{{ U('Album/Product/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>

+ 80 - 11
resources/views/admin/album/product/price/index.blade.php

xqd xqd xqd xqd
@@ -15,15 +15,29 @@
 				<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>
+							<div class="col-sm-2">
+								<select id="data_parent_id" class="form-control" onchange="getLevelSecondCategory()">
+									<option value="0">全部</option>
+									@if(isset($cat))
+										@foreach($cat as $key=>$val)
+											<option value="{{$val->id}}" >{{$val->name}}</option>
+										@endforeach
+									@endif
+								</select>
+							</div>
+							<div class="col-sm-2" id="app">
+								<select name="cat_id" id="data_cat_id" class="form-control"  required="" aria-required="true">
+									<option v-for="item in list.data" :value="item.id">@{{ item.name }}</option>
+								</select>
+							</div>
+							<div class="col-sm-2">
+								<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/Product/Price/create'))
     					<div class="col-sm-3 pull-right">
@@ -37,10 +51,12 @@
     						<tr>
 								
             <th class="sorting" data-sort="id"> ID </th>
-            <th class="sorting" data-sort="product_name"> 商品名 </th>
-            <th class="sorting" data-sort="product_pic"> 商品图片 </th>
+            <th> 商品名 </th>
+            <th> 商品分类 </th>
+            <th> 商品图片 </th>
             <th class="sorting" data-sort="product_id"> 商品ID </th>
             <th class="sorting" data-sort="mobile"> 经销商电话 </th>
+            <th> 厂家价 </th>
             <th class="sorting" data-sort="price"> 价格 </th>
         						{{--<th width="22%">相关操作</th>--}}
         					</tr>
@@ -51,9 +67,11 @@
 								
             <td>{{ $item->id }}</td>
             <td>{{ $item->product_name }}</td>
+            <td>{{ $item->cat }}</td>
             <td><img src="{{ $item->product_pic }}" width="50"/></td>
             <td>{{ $item->product_id }}</td>
             <td>{{ $item->mobile }}</td>
+            <td>{{ $item->product_ma_price_comment }}</td>
             <td>{{ $item->price }}</td>
 								{{--<td>
 									<div class="btn-group">
@@ -102,4 +120,55 @@
 		</div>
 	</div>
 </div>
+<script src="/base/js/vue.js"></script>
+<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';
+    toastr.options.timeOut = '4000';
+
+    var level = new Vue({
+        el:"#app",
+        data:{
+            list:{
+                data:[
+                    {'id':0,'name':'请先选择一级类目'},
+                ],
+            },
+            //      num:0
+        },
+        methods:{
+            changeData:function (e) {
+                Vue.set(this.list,'data',e)
+            }
+        }
+    });
+
+    function getLevelSecondCategory(){
+        var first = $('#data_parent_id').val();
+        if (first == 0) {
+            level.changeData([{'id':-1,'name':'全部'}]);
+            return;
+		}
+        $.ajax({
+            url: "{{ U('Album/Product/getSecondCategory') }}",
+            method: 'POST',
+            data: {
+                'cat_id':first,
+                '_token':"{{ csrf_token() }}"
+            },
+            dataType:'json',
+
+            success: function(data) {
+                if (data.code == 0) {
+                    level.changeData(data.data);
+                } else {
+                    toastr.error(data.message);
+                }
+            }
+        });
+    }
+    getLevelSecondCategory();
+
+</script>
 @endsection

+ 9 - 4
resources/views/admin/album/user/index.blade.php

xqd xqd xqd xqd xqd
@@ -18,7 +18,7 @@
 
                                 <div class="col-sm-4">
                                     <div class="input-group">
-                                        <input type="text" value="{{Request::get('keyword')}}" placeholder="请输入关键词"
+                                        <input type="text" value="{{Request::get('keyword')}}" placeholder="请输入昵称/openid/电话"
                                                name="keyword" class="input-sm form-control">
                                         <span class="input-group-btn">
 									<button type="submit" class="btn btn-sm btn-primary">搜索</button>
@@ -33,7 +33,7 @@
                             <tr>
 
                                 <th class="sorting" data-sort="id">ID</th>
-                                <th class="sorting" data-sort="username"> 名称</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>
@@ -49,7 +49,7 @@
 
                                         <td>{{ $item->id }}</td>
                                         <td>{{ $item->username }}</td>
-                                        <td><img src="{{ $item->avatar }}"/></td>
+                                        <td><img src="{{ $item->avatar }}" width="50px"/></td>
                                         <td>{{ $item->phone }}</td>
                                         @if($item['is_dealer'] == 1&&$item['model']==1)
                                             <td>画册经销商</td>
@@ -61,7 +61,7 @@
                                         <td>
                                             @if(!$item->is_dealer && $item['model']==1)
                                                 <button onclick="window.location.href='{{ U('Album/User/update',['id'=>$item->id]) }}'"
-                                                        class="btn btn-warning">添加经销商
+                                                        class="btn btn-warning">设为经销商
                                                 </button>
                                             @endif
                                             @if($item->role !== 0)
@@ -85,6 +85,11 @@
                                                         class="btn btn-success">设为经理
                                                 </button>
                                             @endif
+                                            @if($item->role !== 3)
+                                                <button onclick="window.location.href='{{ U('Album/User/role',['id'=>$item->id,'role'=>4]) }}'"
+                                                        class="btn btn-waring">设为Boss
+                                                </button>
+                                            @endif
                                         </td>
                                     </tr>
                                 @endforeach

+ 2 - 2
resources/views/admin/auth/login.blade.php

xqd
@@ -15,10 +15,10 @@
 <body class="gray-bg">
 
     <div class="middle-box text-center loginscreen  animated fadeInDown">
-        <div>
+        <div style="margin-top: 45%">
             <div>
                 <div>
-                    <h1 class="logo-name">A+</h1>
+                    <h1 class="logo-name" style="letter-spacing: 5px !important;font-size: 62px;">在线画册</h1>
                 </div>
                 <h3>管理后台</h3>
             </div>

+ 7 - 23
resources/views/admin/furniture/goods/category/index.blade.php

xqd
@@ -59,29 +59,13 @@
                                         <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/Goods/Category/update'))
-                                                        <li>
-                                                            <a href="{{ U('Furniture/Goods/Category/update',['id'=>$item->id])}}"
-                                                               class="font-bold">修改</a></li>
-                                                    @endif
-
-                                                    @if(role('Furniture/Goods/Category/destroy'))
-                                                        <li class="divider"></li>
-                                                        <li>
-                                                            <a href="{{ U('Furniture/Goods/Category/destroy',['id'=>$item->id])}}"
-                                                               onclick="return confirm('你确定执行删除操作?');">删除</a></li>
-                                                    @endif
-
-                                                </ul>
+                                            <div class="pull-left">
+                                                @if(role('Furniture/Goods/Category/update'))
+                                                    <a href="{{ U('Furniture/Goods/Category/update',['id'=>$item->id])}}" class="btn btn-sm btn-warning pull-right">修改</a>
+                                                @endif
+                                                @if(role('Furniture/Goods/Category/destroy'))
+                                                    <a href="{{ U('Furniture/Goods/Category/destroy',['id'=>$item->id])}}" onclick="return confirm('你确定执行删除操作?');" class="btn btn-sm btn-danger pull-right">删除</a>
+                                                @endif
                                             </div>
                                             @if(role('Furniture/Goods/Category/view'))
                                                 <button onclick="layer.open({type: 2,area: ['80%', '90%'],content: '{{ U('Furniture/Goods/Category/view',['id'=>$item->id])}}'});"

+ 7 - 22
resources/views/admin/furniture/goods/index.blade.php

xqd
@@ -57,28 +57,13 @@
                                         <td>@if($item->status ==1) 启用 @else 不启用 @endif</td>
                                         <td>{{ $item->created_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/Goods/update'))
-                                                        <li><a href="{{ U('Furniture/Goods/update',['id'=>$item->id])}}"
-                                                               class="font-bold">修改</a></li>
-                                                    @endif
-
-                                                    @if(role('Furniture/Goods/destroy'))
-                                                        <li class="divider"></li>
-                                                        <li>
-                                                            <a href="{{ U('Furniture/Goods/destroy',['id'=>$item->id])}}"
-                                                               onclick="return confirm('你确定执行删除操作?');">删除</a></li>
-                                                    @endif
-
-                                                </ul>
+                                            <div class="pull-left">
+                                                @if(role('Furniture/Goods/update'))
+                                                    <a href="{{ U('Furniture/Goods/update',['id'=>$item->id])}}" class="btn btn-sm btn-warning pull-right">修改</a>
+                                                @endif
+                                                @if(role('Furniture/Goods/destroy'))
+                                                    <a href="{{ U('Furniture/Goods/destroy',['id'=>$item->id])}}" onclick="return confirm('你确定执行删除操作?');" class="btn btn-sm btn-danger pull-right">删除</a>
+                                                @endif
                                             </div>
                                             @if(role('Furniture/Goods/view'))
                                                 <button onclick="layer.open({type: 2,area: ['80%', '90%'],content: '{{ U('Furniture/Goods/view',['id'=>$item->id])}}'});"

+ 7 - 23
resources/views/admin/furniture/newgoods/comment/index.blade.php

xqd
@@ -62,29 +62,13 @@
                                         <td>{{ mb_substr($item->content,0,10).'...' }}</td>
                                         <td>{{ $item->created_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/Comment/update'))
-                                                        <li>
-                                                            <a href="{{ U('Furniture/Newgoods/Comment/update',['id'=>$item->id])}}"
-                                                               class="font-bold">回复</a></li>
-                                                    @endif
-
-                                                    @if(role('Furniture/Newgoods/Comment/destroy'))
-                                                        <li class="divider"></li>
-                                                        <li>
-                                                            <a href="{{ U('Furniture/Newgoods/Comment/destroy',['id'=>$item->id])}}"
-                                                               onclick="return confirm('你确定执行删除操作?');">删除</a></li>
-                                                    @endif
-
-                                                </ul>
+                                            <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>
+                                                @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
                                             </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])}}'});"

+ 51 - 0
routes/api.php

xqd
@@ -493,6 +493,57 @@ $api->version('v1', ['namespace' => 'App\Http\Controllers\Api\V1'], function ($a
         'as' => 'furniture.newgoods_addbooking',
         'uses' => 'FurnitureController@newgoods_addbooking',
     ]);
+/*
+ *  AlbumBoss
+ */
+    $api->get('album_boss/get_top', [
+        'as' => 'album_boss.get_top',
+        'uses' => 'AlbumBossController@getTop',
+    ]);
+
+    $api->post('album_boss/agent_customer', [
+        'as' => 'album_boss.agent_customer',
+        'uses' => 'AlbumBossController@agentCustomer',
+    ]);
+
+    $api->post('album_boss/agent_statistical', [
+        'as' => 'album_boss.agent_statistical',
+        'uses' => 'AlbumBossController@agentStatistical',
+    ]);
+
+    $api->post('album_boss/agent_overview_active', [
+        'as' => 'album_boss.agent_overview_active',
+        'uses' => 'AlbumBossController@albumOverviewActive',
+    ]);
+
+    $api->post('album_boss/agent_overview_left', [
+        'as' => 'album_boss.agent_overview_left',
+        'uses' => 'AlbumBossController@albumOverviewLeft',
+    ]);
 
+    $api->post('album_boss/agent_overview_favorite', [
+        'as' => 'album_boss.agent_overview_favorite',
+        'uses' => 'AlbumBossController@albumOverviewFavorite',
+    ]);
+
+    $api->post('album_boss/agent_overview_new', [
+        'as' => 'album_boss.agent_overview_new',
+        'uses' => 'AlbumBossController@albumOverviewNew',
+    ]);
+
+    $api->post('album_boss/agent_analysis', [
+        'as' => 'album_boss.agent_analysis',
+        'uses' => 'AlbumBossController@agentAnalysis',
+    ]);
+
+    $api->post('album_boss/agent_overview_call', [
+        'as' => 'album_boss.agent_overview_call',
+        'uses' => 'AlbumBossController@albumOverviewCall',
+    ]);
+
+    $api->post('album_boss/agent_overview_funnel', [
+        'as' => 'album_boss.agent_overview_funnel',
+        'uses' => 'AlbumBossController@albumOverviewFunnel',
+    ]);
 
 });