moonsflyer 4 ماه پیش
والد
کامیت
c7219183d7
4فایلهای تغییر یافته به همراه83 افزوده شده و 13 حذف شده
  1. 40 4
      phalapi/src/app/Api/Home.php
  2. 11 2
      phalapi/src/app/Domain/Home.php
  3. 12 3
      phalapi/src/app/Model/Home.php
  4. 20 4
      phalapi/src/app/functions.php

+ 40 - 4
phalapi/src/app/Api/Home.php

@@ -75,11 +75,14 @@ class Home extends Api {
                 'id' => array('name' => 'id', 'type' => 'int', 'default'=>'1' ,'desc' => '新闻id'),
             ),
             'getClassidShopList' => array(
-                'classid' => array('name' => 'classid', 'type' => 'int', 'default'=>'1' ,'desc' => '分类id'),
+                'type' => array('name' => 'type', 'type' => 'int', 'default'=>'1' ,'desc' => '店铺类型 1:乡村云店; 2:都市云店; 3:一线云店 ;4:普通商户'),
                 'name'=> array('name' => 'name', 'type' => 'string', 'default'=>'' ,'desc' => '店铺名称'),
                 'province'=> array('name' => 'province', 'type' => 'string', 'default'=>'' ,'desc' => '地址省份'),
                 'p' => array('name' => 'p', 'type' => 'int', 'default'=>'1' ,'desc' => '页数'),
             ),
+            'getShopAddressList' => array(
+            ),
+
 		);
 	}
 
@@ -494,17 +497,17 @@ class Home extends Api {
      */
     public function getClassidShopList() {
         $rs = array('code' => 0, 'msg' => '', 'list' => array());
-        $classid=\App\checkNull($this->classid);
+        $type=\App\checkNull($this->type);
         $province=\App\checkNull($this->province);
         $name=\App\checkNull($this->name);
         $p=\App\checkNull($this->p);
 
         $domain=new Domain_Home();
 
-        $key="getClassidShopList_".$classid.'_'.$p;
+        $key="getClassidShopList_".$type.'_'.$p;
         $classidShopList=\App\getcaches($key);
         if(!$classidShopList){
-            $classidShopList = $domain->getClassidShopList($classid,$province,$name,$p);
+            $classidShopList = $domain->getClassidShopList($type,$province,$name,$p);
             \App\setCaches($key,$classidShopList,2);
         }
 
@@ -512,6 +515,39 @@ class Home extends Api {
 
         return $rs;
     }
+
+    /**
+     * 获取分类下店铺列表
+     * @desc 用于获取指定分类下店铺列表
+     * @return int code 操作码,0表示成功
+     * @return array list
+     * @return array list[0]  店铺信息
+     * @return array list[0][uid] 用户店铺id
+     * @return array list[0][name] 店铺名称
+     * @return array list[0][thumb] 店铺图片
+     * @return array list[0][username] 会员名称
+     * @return array list[0][sale_nums] 销售时间
+     * @return array list[0][service_points] 服务评分
+     * @return array list[0][delivery_time] 配送时间
+     * @return string msg 提示信息
+     */
+    public function getShopAddressList() {
+        $rs = array('code' => 0, 'msg' => '', 'list' => array());
+
+        $domain=new Domain_Home();
+
+        $key="getShopAddressList";
+        $shopAddressList=\App\getcaches($key);
+        if(!$shopAddressList){
+            $shopAddressList = $domain->getShopAddressList();
+            \App\setCaches($key,$shopAddressList,2);
+        }
+
+        $rs['list'] = $shopAddressList;
+
+        return $rs;
+    }
+
     /**
      * 获取二级分类
      * @desc 获取一级分类下的二级分类列表

+ 11 - 2
phalapi/src/app/Domain/Home.php

@@ -62,14 +62,23 @@ class Home{
         return $rs;
     }
 
-    public function getClassidShopList($classid,$province,$name,$p){
+    public function getClassidShopList($type,$province,$name,$p){
         $rs = array();
 
         $model = new Model_Home();
-        $rs = $model->getClassidShopLists($classid,$province,$name,$p);
+        $rs = $model->getClassidShopLists($type,$province,$name,$p);
 
         return $rs;
     }
+    public function getShopAddressList(){
+        $rs = array();
+
+        $model = new Model_Home();
+        $rs = $model->getShopAddressList();
+
+        return $rs;
+    }
+
     public function getShopGoodsList($p,$shopclassid){
         $rs = array();
 

+ 12 - 3
phalapi/src/app/Model/Home.php

@@ -151,9 +151,17 @@ class Home extends NotORM{
         $info=\App\getNewsDetail($where);
         return $info;
     }
-    public function getClassidShopLists($classid,$province,$name,$p){
-        $where=['goods_classid'=>$classid];
-        $info=\App\getClassidShopLists($where,$province,$name,$p);
+    public function getClassidShopLists($type,$province,$name,$p){
+//        $where=['type'=>$type];
+        $where['type'] = $type;
+        if(!empty($province)){
+            $where['province'] = $province;
+        }
+        $info=\App\getClassidShopLists($where,$name,$p);
+        return $info;
+    }
+    public function getShopAddressList(){
+        $info=\App\getShopAddressList();
         return $info;
     }
 
@@ -185,6 +193,7 @@ class Home extends NotORM{
 
         return $list;
     }
+
     /*商城-推荐商品*/
     public function getRecomGoodsList(){
         $order="isrecom desc,sale_nums desc,id desc";

+ 20 - 4
phalapi/src/app/functions.php

@@ -4418,20 +4418,35 @@ namespace App;
         return $info;
     }
     //获分类店铺格式化处理
-    function getClassidShopLists($where,$province,$name,$p){
+    function getClassidShopLists($where,$name,$p){
 
         $nums = 20;
         if($p<1){
             $p=1;
         }
         $start=($p-1)*$nums;
-        $rs=\PhalApi\DI()->notorm->seller_goods_class
-            ->select("uid,goods_classid,status")
+        $rs=\PhalApi\DI()->notorm->shop_apply
+            ->select("uid,name,thumb,username,sale_nums,service_points,province")
             ->where($where)
             ->limit($start,$nums)
             ->fetchAll();
         $shop_list = [];
         foreach($rs as &$v){
+            $v['thumb'] =  get_upload_path( $v['thumb']);
+            $v['delivery_time'] =  '35分钟' ;
+        }
+        return $rs;
+    }
+    //获店铺地址
+    function getShopAddressList(){
+
+        $rs=\PhalApi\DI()->notorm->seller_goods_class
+            ->select("uid,goods_classid,status")
+//            ->where($where)
+
+            ->fetchAll();
+        $shop_list = [];
+        foreach($rs as &$v){
             $shopwhere['uid'] = $v['uid'];
             if(!empty($province)){
                 $shopwhere['province']=$province;
@@ -4441,7 +4456,7 @@ namespace App;
                 ->select('uid,name,thumb,username,sale_nums,service_points,province')
                 ->where($shopwhere)
                 ->fetchOne();
-            
+
 //            $v['cate_name']=$cate_name;
 //
 //            $v['addtime'] = date('Y-m-d H:i:s',$shop_info['addtime']);
@@ -4456,6 +4471,7 @@ namespace App;
         }
         return $shop_list;
     }
+
     // 根据不同条件获取物流列表信息
     function getExpressInfo($where){
         $info=\PhalApi\DI()->notorm->shop_express