Explorar el Código

轮播图列表

lizhen_gitee hace 1 año
padre
commit
9ba81b05cf

+ 45 - 0
application/api/controller/company/Banner.php

@@ -0,0 +1,45 @@
+<?php
+
+namespace app\api\controller\company;
+
+use app\common\controller\Apic;
+use think\Db;
+
+/**
+ * 轮播图管理
+ */
+class Banner extends Apic
+{
+    protected $noNeedLogin = [];
+    protected $noNeedRight = '*';
+
+
+    //某门店的轮播图
+    public function banner_list(){
+        $where = [
+            'company_id' => $this->auth->company_id,
+            'position'   => 0, //首页
+        ];
+        $index = Db::name('banner')->where($where)->order('weigh desc,id desc')->select();
+        $index = list_domain_image($index,['image']);
+
+        $where = [
+            'company_id' => $this->auth->company_id,
+            'position'   => 1, //门店印象
+        ];
+        $store = Db::name('banner')->where($where)->order('weigh desc,id desc')->autopage()->select();
+        $store = list_domain_image($store,['image']);
+
+        $rs = [
+            'index' => $index,
+            'store' => $store,
+        ];
+
+        $this->success(1,$rs);
+
+    }
+
+
+
+
+}

+ 0 - 4
application/api/controller/company/Coupon.php

@@ -13,10 +13,6 @@ class Coupon extends Apic
     protected $noNeedLogin = [];
     protected $noNeedRight = '*';
 
-    public function _initialize()
-    {
-        parent::_initialize();
-    }
 
 
     //优惠券管理

+ 1 - 5
application/api/controller/company/Index.php

@@ -13,10 +13,6 @@ class Index extends Apic
     protected $noNeedLogin = [];
     protected $noNeedRight = '*';
 
-    public function _initialize()
-    {
-        parent::_initialize();
-    }
 
     //首页
     public function index(){
@@ -29,7 +25,7 @@ class Index extends Apic
         $where = [
             'company_id' => $this->auth->company_id,
             'status'     => 1,
-            'posisiton'  => 0
+            'position'  => 0
         ];
         $list = Db::name('banner')->where($where)->order('weigh desc,id desc')->autopage()->select();
         $this->success(1,$list);

+ 0 - 4
application/api/controller/company/Order.php

@@ -15,10 +15,6 @@ class Order extends Apic
     protected $noNeedLogin = [];
     protected $noNeedRight = '*';
 
-    public function _initialize()
-    {
-        parent::_initialize();
-    }
 
     //
     public function lists(){

+ 0 - 4
application/api/controller/company/Staff.php

@@ -13,10 +13,6 @@ class Staff extends Apic
     protected $noNeedLogin = [];
     protected $noNeedRight = '*';
 
-    public function _initialize()
-    {
-        parent::_initialize();
-    }
 
 
     //列表

+ 0 - 4
application/api/controller/company/Takecash.php

@@ -13,10 +13,6 @@ class Takecash extends Apic
     protected $noNeedLogin = [];
     protected $noNeedRight = '*';
 
-    public function _initialize()
-    {
-        parent::_initialize();
-    }
 
     //提现配置
     public function take_cash_config(){

+ 0 - 5
application/api/controller/company/User.php

@@ -18,11 +18,6 @@ class User extends Apic
     protected $noNeedLogin = ['accountlogin','resetpwd'];
     protected $noNeedRight = '*';
 
-    public function _initialize()
-    {
-        parent::_initialize();
-
-    }
 
     //员工手机+密码登录
     public function accountlogin(){