审查视图

application/api/controller/Index.php 38.0 KB
wangzhi authored
1 2 3 4 5
<?php

namespace app\api\controller;

use app\common\controller\Api;
wangzhi authored
6
use function fast\e;
wangzhi authored
7 8
use think\Db;
wangzhi authored
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25

/**
 * 首页接口
 */
class Index extends Api
{
    protected $noNeedLogin = ['*'];
    protected $noNeedRight = ['*'];

    /**
     * 首页
     *
     */
    public function index()
    {
        $this->success('请求成功');
    }
wangzhi authored
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46


    /**
     * @ApiTitle    (首页接口-商品目录分类菜单)
     * @ApiSummary  (商品目录分类菜单)
     * @ApiMethod   (POST)
     * @ApiRoute    (/api/Index/ProductList)
     * @ApiReturnParams   (name="code", type="integer", required=true, sample="0")
     * @ApiReturnParams   (name="msg", type="string", required=true, sample="返回成功")
     * @ApiReturn   ({
    'code':'1',
    'msg':'返回成功'
    "data": [
    {
    "class": "一级分类名",
    "id": "ID"
    }]
    })
     */
    public function ProductList()
    {
wangzhi authored
47
        $arr = Db::name('classa')->select();
wangzhi authored
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
        if (empty($arr)) {
            $data = [];
            $this->success('成功', $data);
        }
        foreach ($arr as $k => $v) {
            $return[$k]['class'] = $v['class'];
            $return[$k]['id'] = $v['id'];
        }
        $this->success('成功', $return);
    }


    /**
     * @ApiTitle    (首页接口-品牌选型品牌菜单)
     * @ApiSummary  (品牌选型品牌菜单)
     * @ApiMethod   (POST)
     * @ApiRoute    (/api/Index/LogoList)
     * @ApiReturnParams   (name="code", type="integer", required=true, sample="0")
     * @ApiReturnParams   (name="msg", type="string", required=true, sample="返回成功")
     * @ApiReturn   ({
    'code':'1',
    'msg':'返回成功'
    "data": [
    {
    "logo": "品牌名",
    "id": "ID"
    }]
    })
     */
    public function LogoList()
    {
        $arr = Db::name('logo')->select();
        if (empty($arr)) {
            $data = [];
            $this->success('成功', $data);
        }
        foreach ($arr as $k => $v) {
            $return[$k]['logo'] = $v['logo'];
            $return[$k]['id'] = $v['id'];
        }
        $this->success('成功', $return);
    }

//去除重复数组
    function second_array_unique_bykey($arr, $key)
    {
wangzhi authored
94
        $tmp_arr = [];
wangzhi authored
95 96 97 98 99 100 101 102
        foreach ($arr as $k => $v) {
            if (in_array($v[$key], $tmp_arr))   //搜索$v[$key]是否在$tmp_arr数组中存在,若存在返回true
            {
                unset($arr[$k]); //销毁一个变量  如果$tmp_arr中已存在相同的值就删除该值
            } else {
                $tmp_arr[$k] = $v[$key];  //将不同的值放在该数组中保存
            }
        }
wangzhi authored
103
        sort($arr); //ksort函数对数组进行排序(保留原键值key)  sort为不保留key值
wangzhi authored
104 105 106 107 108 109 110 111 112 113
        return $arr;
    }


    /**
     * @ApiTitle    (首页接口-品牌选型-分类菜单)
     * @ApiSummary  (品牌选型-分类菜单)
     * @ApiMethod   (POST)
     * @ApiRoute    (/api/Index/LogoClassList)
     * @ApiParams   (name="logo", type="integer", required=true, description="品牌")
wangzhi authored
114
     * @ApiParams   (name="isclass", type="integer", required=true, description="分类")
wangzhi authored
115 116 117 118 119
     * @ApiReturnParams   (name="code", type="integer", required=true, sample="0")
     * @ApiReturnParams   (name="msg", type="string", required=true, sample="返回成功")
     * @ApiReturn   ({
    'code':'1',
    'msg':'返回成功'
wangzhi authored
120 121
    "data": {
    "first": [
wangzhi authored
122
    {
wangzhi authored
123 124 125
    "class": "分类6",
    "id": 6
    }
wangzhi authored
126
    "second": [
wangzhi authored
127 128 129
    {
    "class_con": "详细分类6",
    "id": 6
wangzhi authored
130 131 132 133 134 135 136 137
    }
    ]
    }
    })
     */
    public function LogoClassList()
    {
        $param = $this->request->param();
wangzhi authored
138
        if (empty($param['isclass'])) {
wangzhi authored
139 140
            $map = [];
            $map1 = [];
wangzhi authored
141
            if (strstr($param['logo'], ',')) {
wangzhi authored
142 143 144 145
                if (strstr($param['logo'], '0,')) {
                    $count = strpos($param['logo'], "0,");
                    $param['logo'] = substr_replace($param['logo'], "", $count, 2);
                }
wangzhi authored
146
                $map['l.logo_id'] = array('IN', $param['logo']);
wangzhi authored
147
            } else {
wangzhi authored
148 149 150 151 152
                if ($param['logo'] == 0) {
                    $map = [];
                } else {
                    $map['l.logo_id'] = $param['logo'];
                }
wangzhi authored
153
            }
wangzhi authored
154 155 156 157 158 159 160 161 162 163
            $arr = Db::name('logo_class')
                ->alias('l')
                ->join('classa c', 'c.id=l.class_id')
                ->field('c.class,c.id')
                ->where($map)
                ->select();
            if (empty($arr)) {
                $first_arr = [];
            } else {
                $first_arr = $this->second_array_unique_bykey($arr, 'id');
wangzhi authored
164
            }
wangzhi authored
165
            $return['first'] = $first_arr;
wangzhi authored
166
            $return['second'] = [];
wangzhi authored
167 168
            $this->success('成功', $return);
        } else {
wangzhi authored
169 170
            $map = [];
            $map1 = [];
wangzhi authored
171
            if (strstr($param['logo'], ',')) {
wangzhi authored
172 173 174 175
                if (strstr($param['logo'], '0,')) {
                    $count = strpos($param['logo'], "0,");
                    $param['logo'] = substr_replace($param['logo'], "", $count, 2);
                }
wangzhi authored
176
                $map['l.logo_id'] = array('IN', $param['logo']);
wangzhi authored
177
            } else {
wangzhi authored
178 179 180 181 182
                if ($param['logo'] == 0) {
                    $map = [];
                } else {
                    $map['l.logo_id'] = $param['logo'];
                }
wangzhi authored
183
            }
wangzhi authored
184
            if (strstr($param['isclass'], ',')) {
wangzhi authored
185 186 187 188
                if (strstr($param['isclass'], '0,')) {
                    $count = strpos($param['isclass'], "0,");
                    $param['isclass'] = substr_replace($param['isclass'], "", $count, 2);
                }
wangzhi authored
189
                $map1['l.class_id'] = array('IN', $param['isclass']);
wangzhi authored
190
            } else {
wangzhi authored
191 192 193 194 195
                if ($param['isclass'] == 0) {
                    $map1 = [];
                } else {
                    $map1['l.class_id'] = $param['isclass'];
                }
wangzhi authored
196 197
            }
        }
wangzhi authored
198 199 200 201 202 203 204 205 206 207 208
        $arr = Db::name('logo_class')
            ->alias('l')
            ->join('classa c', 'c.id=l.class_id')
            ->field('c.class,c.id')
            ->where($map)
            ->select();
        if (empty($arr)) {
            $first_arr = [];
        } else {
            $first_arr = $this->second_array_unique_bykey($arr, 'id');
        }
wangzhi authored
209
wangzhi authored
210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225
        $arr2 = Db::name('logo_class')
            ->alias('l')
            ->join('class_con c', 'c.id=l.class_con_id')
            ->field('c.class_con,c.id')
            ->where($map)
            ->where($map1)
            ->select();
        if (empty($arr2)) {
            $second_arr = [];
        } else {
            $second_arr = $this->second_array_unique_bykey($arr2, 'id');
        }
        $return['first'] = $first_arr;
        $return['second'] = $second_arr;
        $this->success('成功', $return);
    }
wangzhi authored
226 227 228 229 230 231

    /**
     * @ApiTitle    (首页接口-商品目录-分类菜单)
     * @ApiSummary  (商品目录-分类菜单)
     * @ApiMethod   (POST)
     * @ApiRoute    (/api/Index/ProductClassList)
wangzhi authored
232
     * @ApiParams   (name="isclass", type="integer", required=true, description="分类")
wangzhi authored
233 234 235 236 237 238
     * @ApiParams   (name="class_con", type="integer", required=true, description="详细分类")
     * @ApiReturnParams   (name="code", type="integer", required=true, sample="0")
     * @ApiReturnParams   (name="msg", type="string", required=true, sample="返回成功")
     * @ApiReturn   ({
    'code':'1',
    'msg':'返回成功'
wangzhi authored
239
    "data": {
wangzhi authored
240 241
    "class_con": [
    {
wangzhi authored
242 243 244 245 246
    "class_con": "详细分类1",
    "id":"id"

    }
    ],
wangzhi authored
247 248
    "logo": [
    {
wangzhi authored
249 250 251 252 253
    "logo": "品牌1",
    "id":"id"
    }
    ]
    }
wangzhi authored
254 255
    })
     */
wangzhi authored
256
    public function ProductClassList()
wangzhi authored
257 258
    {
        $param = $this->request->param();
wangzhi authored
259 260 261 262 263 264 265 266 267 268 269 270 271 272
        if (empty($param['class_con'])) {
            $map = [];
            $map1 = [];
            if (strstr($param['isclass'], ',')) {
                if (strstr($param['isclass'], '0,')) {
                    $count = strpos($param['isclass'], "0,");
                    $param['isclass'] = substr_replace($param['isclass'], "", $count, 2);
                }
                $map['l.class_id'] = array('IN', $param['isclass']);
            } else {
                if ($param['isclass'] == 0) {
                    $map = [];
                } else {
                    $map['l.class_id'] = $param['isclass'];
wangzhi authored
273 274
                }
            }
wangzhi authored
275 276 277 278 279 280 281 282 283 284
            $arr = Db::name('logo_class')
                ->alias('l')
                ->join('class_con c', 'c.id=l.class_con_id')
                ->field('c.class_con,c.id')
                ->where($map)
                ->select();
            if (empty($arr)) {
                $first_arr = [];
            } else {
                $first_arr = $this->second_array_unique_bykey($arr, 'id');
wangzhi authored
285
            }
wangzhi authored
286 287
            $return['class_con'] = $first_arr;
            $return['logo'] = [];
wangzhi authored
288 289
            $this->success('成功', $return);
        } else {
wangzhi authored
290 291 292 293 294 295 296 297 298 299 300 301 302 303
            $map = [];
            $map1 = [];
            if (strstr($param['isclass'], ',')) {
                if (strstr($param['isclass'], '0,')) {
                    $count = strpos($param['isclass'], "0,");
                    $param['isclass'] = substr_replace($param['isclass'], "", $count, 2);
                }
                $map['l.class_id'] = array('IN', $param['isclass']);
            } else {
                if ($param['isclass'] == 0) {
                    $map = [];
                } else {
                    $map['l.class_id'] = $param['isclass'];
                }
wangzhi authored
304
            }
wangzhi authored
305 306 307 308 309 310 311 312 313 314 315 316
            if (strstr($param['class_con'], ',')) {
                if (strstr($param['class_con'], '0,')) {
                    $count = strpos($param['class_con'], "0,");
                    $param['class_con'] = substr_replace($param['class_con'], "", $count, 2);
                }
                $map1['l.class_con_id'] = array('IN', $param['class_con']);
            } else {
                if ($param['class_con'] == 0) {
                    $map1 = [];
                } else {
                    $map1['l.class_con_id'] = $param['class_con'];
                }
wangzhi authored
317 318
            }
        }
wangzhi authored
319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345
        $arr = Db::name('logo_class')
            ->alias('l')
            ->join('class_con c', 'c.id=l.class_con_id')
            ->field('c.class_con,c.id')
            ->where($map)
            ->select();
        if (empty($arr)) {
            $first_arr = [];
        } else {
            $first_arr = $this->second_array_unique_bykey($arr, 'id');
        }

        $arr2 = Db::name('logo_class')
            ->alias('l')
            ->join('logo c', 'c.id=l.logo_id')
            ->field('c.logo,c.id')
            ->where($map)
            ->where($map1)
            ->select();
        if (empty($arr2)) {
            $second_arr = [];
        } else {
            $second_arr = $this->second_array_unique_bykey($arr2, 'id');
        }
        $return['class_con'] = $first_arr;
        $return['logo'] = $second_arr;
        $this->success('成功', $return);
wangzhi authored
346 347 348 349 350 351 352 353
    }


    /**
     * @ApiTitle    (首页接口-筛选)
     * @ApiSummary  (筛选)
     * @ApiMethod   (POST)
     * @ApiRoute    (/api/Index/ProductChoose)
wangzhi authored
354
     * @ApiParams   (name="isclass", type="integer", required=true, description="分类")
wangzhi authored
355 356
     * @ApiParams   (name="class_con", type="integer", required=true, description="详细分类")
     * @ApiParams   (name="logo", type="integer", required=true, description="品牌")
wangzhi authored
357
     * @ApiParams   (name="keywords", type="string", required=true, description="搜索")
wangzhi authored
358 359 360 361 362 363 364
     * @ApiParams   (name="pages", type="int", required=true, description="页数")
     * @ApiParams   (name="rows", type="int", required=true, description="数据数量")
     * @ApiReturnParams   (name="code", type="integer", required=true, sample="0")
     * @ApiReturnParams   (name="msg", type="string", required=true, sample="返回成功")
     * @ApiReturn   ({
    'code':'1',
    'msg':'返回成功'
wangzhi authored
365 366
    "data": {
    "count": 2,
wangzhi authored
367
    "num_count":页数
wangzhi authored
368
    "list": [
wangzhi authored
369
    {
wangzhi authored
370
    "avatar": "http://qco519e0n.bkt.clouddn.com/uploads/20200703/Fpi3RGA38eqT3eDk_sh99hOZ7wAA.png",
wangzhi authored
371
    "name": "12kf(123)+10.50v",
wangzhi authored
372
    "class_con": "详细分类1",
wangzhi authored
373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399
    "logo": "品牌1",
    "gradient": [
    {
    "tidu": "100",
    "price": "0.10"
    },
    {
    "tidu": "200",
    "price": "0.20"
    },
    {
    "tidu": "300",
    "price": "0.30"
    },
    {
    "tidu": "400",
    "price": "0.40"
    },
    {
    "tidu": "500",
    "price": "0.50"
    }
    ],
    "book_con": "http://qco519e0n.bkt.clouddn.com/uploads/20200629/XBS053V15R.pdf"
    },
    {
    "avatar": "http://qco519e0n.bkt.clouddn.com/uploads/20200703/Fpi3RGA38eqT3eDk_sh99hOZ7wAA.png",
wangzhi authored
400
    "name": "12kf(123)+10.50v",
wangzhi authored
401
    "class_con": "详细分类1",
wangzhi authored
402
    "logo": "品牌1",
wangzhi authored
403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424
    "gradient": [
    {
    "tidu": "100",
    "price": "0.10"
    },
    {
    "tidu": "200",
    "price": "0.20"
    },
    {
    "tidu": "300",
    "price": "0.30"
    },
    {
    "tidu": "400",
    "price": "0.40"
    },
    {
    "tidu": "500",
    "price": "0.50"
    }
    ],
wangzhi authored
425
    "book_con": "http://qco519e0n.bkt.clouddn.com/uploads/20200629/XBS053V15R.pdf"
wangzhi authored
426 427
    }
    ]
wangzhi authored
428
    }
wangzhi authored
429 430
    })
     */
wangzhi authored
431
    public function ProductChoose()
wangzhi authored
432 433 434 435 436
    {
        $param = $this->request->param();
        $map1 = [];
        $map2 = [];
        $map3 = [];
wangzhi authored
437
        $map4 = [];
wangzhi authored
438 439 440 441 442 443 444
        if (!empty($param['isclass']) || $param['isclass'] != null || $param['isclass'] != '') {
            if (strstr($param['isclass'], '0,')) {
                $count = strpos($param['isclass'], "0,");
                $param['isclass'] = substr_replace($param['isclass'], "", $count, 2);
            }
            if ($param['isclass'] == 0) {
                $map1 = [];
wangzhi authored
445
            }
wangzhi authored
446
            $map1['class_id'] = array('IN', $param['isclass']);
wangzhi authored
447
        }
wangzhi authored
448
        if (!empty($param['class_con']) || $param['class_con'] != null || $param['class_con'] != '') {
wangzhi authored
449 450 451 452
            if (strstr($param['class_con'], '0,')) {
                $count = strpos($param['class_con'], "0,");
                $param['class_con'] = substr_replace($param['class_con'], "", $count, 2);
            }
wangzhi authored
453 454
            if ($param['class_con'] == 0) {
                $map2 = [];
wangzhi authored
455
            }
wangzhi authored
456
            $map2['class_con_id'] = array('IN', $param['class_con']);
wangzhi authored
457
        }
wangzhi authored
458
        if (!empty($param['logo']) || $param['logo'] != null || $param['logo'] != '') {
wangzhi authored
459 460 461 462
            if (strstr($param['logo'], '0,')) {
                $count = strpos($param['logo'], "0,");
                $param['logo'] = substr_replace($param['logo'], "", $count, 2);
            }
wangzhi authored
463 464
            if ($param['logo'] == 0) {
                $map3 = [];
wangzhi authored
465
            }
wangzhi authored
466
            $map3['logo_id'] = array('IN', $param['logo']);
wangzhi authored
467
        }
wangzhi authored
468
        if (!empty($param['keywords']) || $param['keywords'] != null || $param['keywords'] != '') {
wangzhi authored
469
            //搜索逻辑
wangzhi authored
470
            $map4['a.name'] = array('LIKE', '%' . $param['keywords'] . '%');
wangzhi authored
471 472
            $product_title = Db::name('product')->where('name', 'LIKE', '%' . $param['keywords'] . '%')->find();
            if (!empty($product_title)) {
wangzhi authored
473
                Db::name('so_level_num')->insert(['product_id' => $product_title['id'], 'keywords' => $param['keywords'], 'createtime' => time()]);
wangzhi authored
474
                $so_num = Db::name('so_level')->where(['product_id' => $product_title['id']])->value('num');
wangzhi authored
475
                if (empty($so_num)) {
wangzhi authored
476
                    Db::name('so_level')->insert(['product_id' => $product_title['id'], 'num' => 1, 'createtime' => time()]);
wangzhi authored
477 478
                } else {
                    Db::name('so_level')->where('product_id', $product_title['id'])->update(['num' => $so_num + 1]);
wangzhi authored
479
                }
wangzhi authored
480
            }
wangzhi authored
481
            //搜索逻辑
wangzhi authored
482
        }
wangzhi authored
483
        $product_id = \db('product')
wangzhi authored
484 485 486
            ->alias('a')
            ->join('logo b', 'b.id=a.logo_id')
            ->join('class_con d', 'd.id=a.class_con_id')
wangzhi authored
487
            ->join('classa c', 'c.id=a.class_id')
wangzhi authored
488
            ->field('a.id,a.avatar,d.class_con,a.name,c.class,b.logo,a.fengzhuang,a.con,a.stock,a.book_avatar,a.tidu1,a.price1,a.tidu2,a.price2,a.tidu3,a.price3,a.tidu4,a.price4,a.tidu5,a.price5')
wangzhi authored
489 490 491
            ->where($map1)
            ->where($map2)
            ->where($map3)
wangzhi authored
492
            ->where($map4)
wangzhi authored
493 494
            ->page($param['pages'], $param['rows'])
            ->select();
wangzhi authored
495 496 497 498 499 500
        if (empty($product_id)) {
            $return['count'] = [];
            $return['list'] = [];
            $this->success('成功', $return);
            die;
        }
wangzhi authored
501 502
        foreach ($product_id as $k => $v) {
            $lists[$k] = $this->product_arr($v['id']);
wangzhi authored
503
        }
wangzhi authored
504
        $list = $this->three_arr($lists);
wangzhi authored
505 506 507 508 509 510 511 512 513
        $count = \db('product')
            ->alias('a')
            ->join('logo b', 'b.id=a.logo_id')
            ->join('class_con d', 'd.id=a.class_con_id')
            ->join('classa c', 'c.id=a.class_id')
            ->field('a.id,a.avatar,d.class_con,a.name,c.class,b.logo,a.fengzhuang,a.con,a.stock,a.book_avatar,a.tidu1,a.price1,a.tidu2,a.price2,a.tidu3,a.price3,a.tidu4,a.price4,a.tidu5,a.price5')
            ->where($map1)
            ->where($map2)
            ->where($map3)
wangzhi authored
514
            ->where($map4)
wangzhi authored
515
            ->select();
wangzhi authored
516
        foreach ($product_id as $k1 => $v1) {
wangzhi authored
517 518 519
            $list[$k1]['avatar'] = cdnurl($v1['avatar'], true);
            $list[$k1]['book_con'] = cdnurl($v1['book_avatar'], true);
        }
wangzhi authored
520 521 522
        foreach ($list as $k => $v) {
            $list[$k]['number'] = 100;
        }
wangzhi authored
523
        $return['count'] = count($count);
wangzhi authored
524
        $return['num_count'] = ceil($return['count'] / $param['rows']);
wangzhi authored
525
        $return['list'] = $list;
wangzhi authored
526
        $this->success('成功', $return);
wangzhi authored
527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542
    }


    /**
     * @ApiTitle    (首页接口-原厂目录)
     * @ApiSummary  (原厂目录)
     * @ApiMethod   (POST)
     * @ApiRoute    (/api/Index/CricleLogoList)
     * @ApiParams   (name="logo", type="integer", required=true, description="品牌ID")
     * @ApiParams   (name="pages", type="int", required=true, description="页数")
     * @ApiParams   (name="rows", type="int", required=true, description="数据数量")
     * @ApiReturnParams   (name="code", type="integer", required=true, sample="0")
     * @ApiReturnParams   (name="msg", type="string", required=true, sample="返回成功")
     * @ApiReturn   ({
    'code':'1',
    'msg':'返回成功'
wangzhi authored
543 544
    "data": {
    "count": 总数,
wangzhi authored
545
    "num_count":"页数"
wangzhi authored
546 547
    "choose": [
    {
wangzhi authored
548
    "choose_id": 筛选品牌ID
wangzhi authored
549
    }
wangzhi authored
550
    ],
wangzhi authored
551 552
    "con": [
    {
wangzhi authored
553 554 555 556 557
    "avatar": "/uploads/20200629/6f62660f0d61cc35b72ec724284d0e17d619a7bc1dbc-SuLXuH_fw658@2x.png",
    "logo": "品牌1",
    "content": "富文本",
    "web": "公司官网",
    "id": 1
wangzhi authored
558 559 560 561 562
    }
    ]
    }
    })
     */
wangzhi authored
563 564
    public
    function CricleLogoList()
wangzhi authored
565 566 567 568 569 570 571 572 573
    {
        $param = $this->request->param();
        $map = [];
        if (!empty($param['logo'])) {
            $map['id'] = array('eq', $param['logo']);
        }
        $choose_id_arr = Db::name('logo')->select();
        foreach ($choose_id_arr as $k => $v) {
            $return1[$k]['choose_id'] = $v['id'];
wangzhi authored
574
            $return1[$k]['logo'] = $v['logo'];
wangzhi authored
575 576
        }
        $logo_arr = Db::name('logo')->where($map)->page($param['pages'], $param['rows'])->select();
wangzhi authored
577
        $logo_arr2 = Db::name('logo')->where($map)->select();
wangzhi authored
578
        foreach ($logo_arr as $k => $v) {
wangzhi authored
579
            $return2[$k]['avatar'] = cdnurl($v['avatar']);
wangzhi authored
580 581 582 583 584
            $return2[$k]['logo'] = $v['logo'];
            $return2[$k]['content'] = $v['content'];
            $return2[$k]['web'] = $v['web'];
            $return2[$k]['id'] = $v['id'];
        }
wangzhi authored
585
        $return['count'] = count($logo_arr2);
wangzhi authored
586
        $return['num_count'] = ceil($return['count'] / $param['rows']);
wangzhi authored
587
//        $return['num_count'] = $return['count'] / $param['rows'];
wangzhi authored
588 589
        $return['choose'] = $return1;
        $return['con'] = $return2;
wangzhi authored
590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606
        $this->success('成功', $return);
    }


    /**
     * @ApiTitle    (首页接口-授权代理)
     * @ApiSummary  (授权代理)
     * @ApiMethod   (POST)
     * @ApiRoute    (/api/Index/AuthorizedAgentLogoList)
     * @ApiParams   (name="logo", type="integer", required=true, description="品牌ID")
     * @ApiParams   (name="pages", type="int", required=true, description="页数")
     * @ApiParams   (name="rows", type="int", required=true, description="数据数量")
     * @ApiReturnParams   (name="code", type="integer", required=true, sample="0")
     * @ApiReturnParams   (name="msg", type="string", required=true, sample="返回成功")
     * @ApiReturn   ({
    'code':'1',
    'msg':'返回成功'
wangzhi authored
607 608
    "data": {
    "count": 总数,
wangzhi authored
609
    "num_count":"页数"
wangzhi authored
610 611
    "choose": [
    {
wangzhi authored
612
    "choose_id": 筛选品牌ID
wangzhi authored
613
    }
wangzhi authored
614
    ],
wangzhi authored
615 616
    "con": [
    {
wangzhi authored
617 618 619 620 621
    "avatar": "/uploads/20200629/6f62660f0d61cc35b72ec724284d0e17d619a7bc1dbc-SuLXuH_fw658@2x.png",
    "logo": "品牌1",
    "content": "富文本",
    "web": "公司官网",
    "id": 1
wangzhi authored
622 623 624 625 626 627
    }
    ]
    }
    ]
    })
     */
wangzhi authored
628 629
    public
    function AuthorizedAgentLogoList()
wangzhi authored
630 631 632 633 634 635 636 637 638
    {
        $param = $this->request->param();
        $map = [];
        if (!empty($param['logo'])) {
            $map['id'] = array('eq', $param['logo']);
        }
        $choose_id_arr = Db::name('logo')->where(['status' => 1])->select();
        foreach ($choose_id_arr as $k => $v) {
            $return1[$k]['choose_id'] = $v['id'];
wangzhi authored
639
            $return1[$k]['logo'] = $v['logo'];
wangzhi authored
640 641
        }
        $logo_arr = Db::name('logo')->where($map)->where(['status' => 1])->page($param['pages'], $param['rows'])->select();
wangzhi authored
642
        $logo_arr2 = Db::name('logo')->where($map)->where(['status' => 1])->select();
wangzhi authored
643
        foreach ($logo_arr as $k => $v) {
wangzhi authored
644
            $return2[$k]['avatar'] = cdnurl($v['avatar']);
wangzhi authored
645 646 647 648 649
            $return2[$k]['logo'] = $v['logo'];
            $return2[$k]['content'] = $v['content'];
            $return2[$k]['web'] = $v['web'];
            $return2[$k]['id'] = $v['id'];
        }
wangzhi authored
650
        $return['count'] = count($logo_arr2);
wangzhi authored
651
        $return['num_count'] = ceil($return['count'] / $param['rows']);
wangzhi authored
652 653
        $return['choose'] = $return1;
        $return['con'] = $return2;
wangzhi authored
654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675
        $this->success('成功', $return);
    }


    /**
     * @ApiTitle    (首页接口-首页品牌展示)
     * @ApiSummary  (首页品牌展示)
     * @ApiMethod   (POST)
     * @ApiRoute    (/api/Index/IndexLogoAvatar)
     * @ApiReturnParams   (name="code", type="integer", required=true, sample="0")
     * @ApiReturnParams   (name="msg", type="string", required=true, sample="返回成功")
     * @ApiReturn   ({
    'code':'1',
    'msg':'返回成功'
    "data": [
    {
    "avatar": "品牌图",
    "id": "id"
    }
    ]
    })
     */
wangzhi authored
676 677
    public
    function IndexLogoAvatar()
wangzhi authored
678 679 680
    {
        $logo_arr = Db::name('logo')->where(['status' => 1])->select();
        foreach ($logo_arr as $k => $v) {
wangzhi authored
681
            $return[$k]['avatar'] = cdnurl($v['avatar']);
wangzhi authored
682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699
            $return[$k]['id'] = $v['id'];
        }
        $this->success('成功', $return);
    }


    /**
     * @ApiTitle    (首页接口-首页轮播图)
     * @ApiSummary  (首页轮播图)
     * @ApiMethod   (POST)
     * @ApiRoute    (/api/Index/IndexBannerImages)
     * @ApiReturnParams   (name="code", type="integer", required=true, sample="0")
     * @ApiReturnParams   (name="msg", type="string", required=true, sample="返回成功")
     * @ApiReturn   ({
    'code':'1',
    'msg':'返回成功'
    "data": [
    {
wangzhi authored
700 701
    "BannerList": [
    {
wangzhi authored
702
    "avatar": "轮播图",
wangzhi authored
703 704
    "id": 1,
    "web": 链接
wangzhi authored
705 706 707 708 709 710 711 712 713
    }
    ]
    },
    {
    "BackgroundlList ": [
    {
    "color": "颜色"
    }
    ]
wangzhi authored
714 715 716 717
    }
    ]
    })
     */
wangzhi authored
718 719
    public
    function IndexBannerImages()
wangzhi authored
720
    {
wangzhi authored
721
        $index_banner_img_arr = Db::name('index_banner')->order('weight desc')->select();
wangzhi authored
722
        foreach ($index_banner_img_arr as $k => $v) {
wangzhi authored
723 724
            $return1[$k]['avatar'] = cdnurl($v['avatar']);
            $return1[$k]['id'] = $v['id'];
wangzhi authored
725
            $return1[$k]['web'] = $v['web'];
wangzhi authored
726
            $return2[$k]['color'] = $v['color'];
wangzhi authored
727
        }
wangzhi authored
728 729
        $return['BannerList'] = $return1;
        $return['BackgroundlList'] = $return2;
wangzhi authored
730
wangzhi authored
731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752
        $this->success('成功', $return);
    }


    /**
     * @ApiTitle    (首页接口-客服电话)
     * @ApiSummary  (客服电话)
     * @ApiMethod   (POST)
     * @ApiRoute    (/api/Index/IndexKfPhone)
     * @ApiReturnParams   (name="code", type="integer", required=true, sample="0")
     * @ApiReturnParams   (name="msg", type="string", required=true, sample="返回成功")
     * @ApiReturn   ({
    'code':'1',
    'msg':'返回成功'
    "data": [
    {
    "phone": "客服电话",
    "id": "id"
    }
    ]
    })
     */
wangzhi authored
753 754
    public
    function IndexKfPhone()
wangzhi authored
755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782
    {
        $kf_phone_arr = Db::name('kf_phone')->select();
        foreach ($kf_phone_arr as $k => $v) {
            $return[$k]['phone'] = $v['phone'];
            $return[$k]['id'] = $v['id'];
        }
        $this->success('成功', $return);
    }


    /**
     * @ApiTitle    (首页接口-常见问题)
     * @ApiSummary  (常见问题)
     * @ApiMethod   (POST)
     * @ApiRoute    (/api/Index/CommonProblem)
     * @ApiReturnParams   (name="code", type="integer", required=true, sample="0")
     * @ApiReturnParams   (name="msg", type="string", required=true, sample="返回成功")
     * @ApiReturn   ({
    'code':'1',
    'msg':'返回成功'
    "data": [
    {
    "content": "常见问题",
    "id": "id"
    }
    ]
    })
     */
wangzhi authored
783 784
    public
    function CommonProblem()
wangzhi authored
785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812
    {
        $problem = Db::name('problem')->select();
        foreach ($problem as $k => $v) {
            $return[$k]['content'] = $v['content'];
            $return[$k]['id'] = $v['id'];
        }
        $this->success('成功', $return);
    }


    /**
     * @ApiTitle    (首页接口-发票须知)
     * @ApiSummary  (发票须知)
     * @ApiMethod   (POST)
     * @ApiRoute    (/api/Index/InvoiceInstructions)
     * @ApiReturnParams   (name="code", type="integer", required=true, sample="0")
     * @ApiReturnParams   (name="msg", type="string", required=true, sample="返回成功")
     * @ApiReturn   ({
    'code':'1',
    'msg':'返回成功'
    "data": [
    {
    "content": "发票须知",
    "id": "id"
    }
    ]
    })
     */
wangzhi authored
813 814
    public
    function InvoiceInstructions()
wangzhi authored
815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842
    {
        $invoice = Db::name('invoice')->select();
        foreach ($invoice as $k => $v) {
            $return[$k]['content'] = $v['content'];
            $return[$k]['id'] = $v['id'];
        }
        $this->success('成功', $return);
    }


    /**
     * @ApiTitle    (首页接口-联系我们)
     * @ApiSummary  (联系我们)
     * @ApiMethod   (POST)
     * @ApiRoute    (/api/Index/ContactUs)
     * @ApiReturnParams   (name="code", type="integer", required=true, sample="0")
     * @ApiReturnParams   (name="msg", type="string", required=true, sample="返回成功")
     * @ApiReturn   ({
    'code':'1',
    'msg':'返回成功'
    "data": [
    {
    "content": "联系我们",
    "id": "id"
    }
    ]
    })
     */
wangzhi authored
843 844
    public
    function ContactUs()
wangzhi authored
845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869
    {
        $contact = Db::name('contact')->select();
        foreach ($contact as $k => $v) {
            $return[$k]['content'] = $v['content'];
            $return[$k]['id'] = $v['id'];
        }
        $this->success('成功', $return);
    }


    /**
     * @ApiTitle    (首页接口-备案信息)
     * @ApiSummary  (备案信息)
     * @ApiMethod   (POST)
     * @ApiRoute    (/api/Index/RecordInformation)
     * @ApiReturnParams   (name="code", type="integer", required=true, sample="0")
     * @ApiReturnParams   (name="msg", type="string", required=true, sample="返回成功")
     * @ApiReturn   ({
    'code':'1',
    'msg':'返回成功'
    "data": {
    "RecordInformation": "备案信息"
    }
    })
     */
wangzhi authored
870 871
    public
    function RecordInformation()
wangzhi authored
872
    {
wangzhi authored
873 874
        $config = Db::name('config')->where(['id' => 2])->find();
        $return['RecordInformation'] = $config['value'];
wangzhi authored
875 876
        $this->success('成功', $return);
    }
wangzhi authored
877 878 879 880 881 882 883 884 885 886 887 888 889 890 891


    /**
     * @ApiTitle    (首页接口-搜索排行)
     * @ApiSummary  (搜索排行)
     * @ApiMethod   (POST)
     * @ApiRoute    (/api/Index/SearchRanking)
     * @ApiParams   (name="type", type="int", required=true, description="1=日搜索排行,2=周搜索排行")
     * @ApiReturnParams   (name="code", type="integer", required=true, sample="0")
     * @ApiReturnParams   (name="msg", type="string", required=true, sample="返回成功")
     * @ApiReturn   ({
    'code':'1',
    'msg':'返回成功'
    })
     */
wangzhi authored
892 893
    public
    function SearchRanking()
wangzhi authored
894 895 896
    {
        $type = input('type');
        if ($type == 1) {
wangzhi authored
897 898
            $map = [];
            $beginToday = mktime(0, 0, 0, date('m'), date('d'), date('Y'));
wangzhi authored
899
            $map['s.createtime'] = array('gt', $beginToday);
wangzhi authored
900 901 902
            $so_arr = Db::name('so_level_num')
                ->alias('s')
                ->join('product p', 'p.id = s.product_id')
wangzhi authored
903
                ->where($map)
wangzhi authored
904
                ->page(1, 10)
wangzhi authored
905
                ->group('s.product_id')
wangzhi authored
906
                ->field("count(*) as count,p.name,s.id")
wangzhi authored
907
                ->order('count desc')
wangzhi authored
908
                ->select();
wangzhi authored
909
            foreach ($so_arr as $k => $v) {
wangzhi authored
910 911
                $return[$k]['title'] = $v['name'];
                $return[$k]['num'] = $v['count'];
wangzhi authored
912
                $return[$k]['id'] = $v['id'];
wangzhi authored
913
            }
wangzhi authored
914 915 916 917
            if (empty($return)) {
                $return = [];
                $this->success('成功', $return);
            }
wangzhi authored
918 919
            $this->success('成功', $return);
        } else {
wangzhi authored
920 921
            $map2 = [];
            $beginWeek = mktime(0, 0, 0, date("m"), date("d") - date("w") + 1, date("Y"));
wangzhi authored
922
            $map2['s.createtime'] = array('GT', $beginWeek);
wangzhi authored
923 924 925 926 927 928 929 930 931
            $so_arr = Db::name('so_level_num')
                ->alias('s')
                ->join('product p', 'p.id = s.product_id')
                ->where($map2)
                ->page(1, 10)
                ->group('s.product_id')
                ->field("count(*) as count,p.name,s.id")
                ->order('count desc')
                ->select();
wangzhi authored
932
            foreach ($so_arr as $k => $v) {
wangzhi authored
933 934
                $return[$k]['title'] = $v['name'];
                $return[$k]['num'] = $v['count'];
wangzhi authored
935
                $return[$k]['id'] = $v['id'];
wangzhi authored
936
            }
wangzhi authored
937 938 939 940
            if (empty($return)) {
                $return = [];
                $this->success('成功', $return);
            }
wangzhi authored
941 942 943
            $this->success('成功', $return);
        }
    }
wangzhi authored
944 945 946 947 948 949 950 951 952 953 954 955


    /**
     * @ApiTitle    (首页接口-首页左侧分类)
     * @ApiSummary  (首页左侧分类)
     * @ApiMethod   (POST)
     * @ApiRoute    (/api/Index/ClassificationOnTheLeftSideOfTheHomePage)
     * @ApiReturnParams   (name="code", type="integer", required=true, sample="0")
     * @ApiReturnParams   (name="msg", type="string", required=true, sample="返回成功")
     * @ApiReturn   ({
    'code':'1',
    'msg':'返回成功'
wangzhi authored
956 957 958 959 960 961 962 963 964 965 966 967 968
    "data": {
    "MoniList": [
    {
    "id": 1,
    "title": "分类1",
    "list": [
    {
    "id": 1,
    "title": "详细分类1"
    }
    ]
    ]
    }
wangzhi authored
969 970
    })
     */
wangzhi authored
971 972 973 974
    public function ClassificationOnTheLeftSideOfTheHomePage()
    {
        $class = Db::name('classa')->select();
        $logo = Db::name('logo')->select();
王智 authored
975
wangzhi authored
976 977
        foreach ($class as $k => $v) {
            $CL_list1[$k]['id'] = $v['id'];
王智 authored
978
            $CL_list[$k]['fid'] = $v['id'];
wangzhi authored
979
            $CL_list[$k]['title'] = $v['class'];
王智 authored
980
        }
王智 authored
981
        foreach ($CL_list1 as $k => $v) {
王智 authored
982 983 984
            if($k>1){
                break;
            }
王智 authored
985 986
            $second_arr2[$k] = Db::name('class_con')->where(['class_ids' => $v['id']])->select();
            if (!empty($second_arr2[$k])) {
王智 authored
987
                $second_arr = $second_arr2[$k];
王智 authored
988
                foreach ($second_arr as $k3 => $v3) {
王智 authored
989 990 991
                    $second_arr3[$k3]['xid'] = $v3['id'];
                    $second_arr3[$k3]['title'] = $v3['class_con'];
                }
王智 authored
992 993 994
                foreach ($second_arr3 as $k2 => $v2) {
                    $CL_list[$k]['IsList'] = $second_arr3;
                }
王智 authored
995
            }
王智 authored
996
        }
王智 authored
997
王智 authored
998
        print_r($CL_list);
王智 authored
999
        die;
wangzhi authored
1000 1001 1002

        foreach ($logo as $k => $v) {
            $LG_list1[$k]['id'] = $v['id'];
王智 authored
1003
            $LG_list[$k]['fid'] = $v['id'];
wangzhi authored
1004
            $LG_list[$k]['title'] = $v['logo'];
wangzhi authored
1005 1006 1007 1008 1009 1010 1011 1012 1013 1014
            foreach ($LG_list1 as $k1 => $v1) {
                $first_arr[$k] = Db::name('logo_class')->where(['logo_id' => $v['id']])->select();
                if (empty($first_arr[$k1])) {
                    array_splice($LG_list, $k1, $k1);
                    array_splice($LG_list1, $k1, $k1);
                }
            }
        }
        foreach ($LG_list1 as $k => $v) {
            $fitst2[0] = Db::name('logo_class')->where(['logo_id' => $v['id']])->select();
王智 authored
1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025
            $fitst3 = $this->three_arr($fitst2);
            foreach ($fitst3 as $k1 => $v1) {
                $fitst4[$k1] = Db::name('classa')->where(['id' => $v1['class_id']])->select();
                $fitst5 = $this->three_arr($fitst4);
            }
            foreach ($fitst5 as $k3 => $v3) {
                $fitst6[$k3]['xid'] = $v3['id'];
                $fitst6[$k3]['title'] = $v3['class'];
            }
            foreach ($fitst6 as $k2 => $v2) {
                $LG_list[$k]['IsList'] = $fitst6;
wangzhi authored
1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042
            }
        }
        $MoList = array(
            array(
                'id' => 1,
                'title' => '零件分类',
                'list' => $CL_list
            ),
            array(
                'id' => 2,
                'title' => '品牌',
                'list' => $LG_list
            ),
        );
        $return['MonList'] = $MoList;
        $this->success('1', $return);
        die;
wangzhi authored
1043
    }
王智 authored
1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199


    /**
     * @ApiTitle    (首页接口-左侧筛选)
     * @ApiSummary  (左侧筛选)
     * @ApiMethod   (POST)
     * @ApiRoute    (/api/Index/LeftProductChoose)
     * @ApiParams   (name="isclass", type="integer", required=true, description="分类")
     * @ApiParams   (name="class_con", type="integer", required=true, description="详细分类")
     * @ApiParams   (name="logo", type="integer", required=true, description="品牌")
     * @ApiParams   (name="pages", type="int", required=true, description="页数")
     * @ApiParams   (name="rows", type="int", required=true, description="数据数量")
     * @ApiReturnParams   (name="code", type="integer", required=true, sample="0")
     * @ApiReturnParams   (name="msg", type="string", required=true, sample="返回成功")
     * @ApiReturn   ({
    'code':'1',
    'msg':'返回成功'
    "data": {
    "count": 2,
    "num_count":页数
    "list": [
    {
    "avatar": "http://qco519e0n.bkt.clouddn.com/uploads/20200703/Fpi3RGA38eqT3eDk_sh99hOZ7wAA.png",
    "name": "12kf(123)+10.50v",
    "class_con": "详细分类1",
    "logo": "品牌1",
    "gradient": [
    {
    "tidu": "100",
    "price": "0.10"
    },
    {
    "tidu": "200",
    "price": "0.20"
    },
    {
    "tidu": "300",
    "price": "0.30"
    },
    {
    "tidu": "400",
    "price": "0.40"
    },
    {
    "tidu": "500",
    "price": "0.50"
    }
    ],
    "book_con": "http://qco519e0n.bkt.clouddn.com/uploads/20200629/XBS053V15R.pdf"
    },
    {
    "avatar": "http://qco519e0n.bkt.clouddn.com/uploads/20200703/Fpi3RGA38eqT3eDk_sh99hOZ7wAA.png",
    "name": "12kf(123)+10.50v",
    "class_con": "详细分类1",
    "logo": "品牌1",
    "gradient": [
    {
    "tidu": "100",
    "price": "0.10"
    },
    {
    "tidu": "200",
    "price": "0.20"
    },
    {
    "tidu": "300",
    "price": "0.30"
    },
    {
    "tidu": "400",
    "price": "0.40"
    },
    {
    "tidu": "500",
    "price": "0.50"
    }
    ],
    "book_con": "http://qco519e0n.bkt.clouddn.com/uploads/20200629/XBS053V15R.pdf"
    }
    ]
    }
    })
     */
    public function LeftProductChoose()
    {
        $param = $this->request->param();
        $map1 = [];
        $map2 = [];
        $map3 = [];
        if (!empty($param['isclass']) || $param['isclass'] != null || $param['isclass'] != '') {
            $class_id = Db::name('classa')->where(['class' => $param['isclass']])->value('id');
            if (empty($class_id)) {
                $map1 = [];
            } else {
                $map1['class_id'] = array('EQ', $class_id);
            }
        }
        if (!empty($param['class_con']) || $param['class_con'] != null || $param['class_con'] != '') {
            $class_con_id = Db::name('class_con')->where(['class_con' => $param['class_con']])->value('id');
            if (empty($class_con_id)) {
                $map2 = [];
            } else {
                $map2['class_con_id'] = array('eq', $class_con_id);
            }
        }
        if (!empty($param['logo']) || $param['logo'] != null || $param['logo'] != '') {
            $logo_id = Db::name('logo')->where(['logo' => $param['logo']])->value('id');
            if (empty($logo_id)) {
                $map3 = [];
            } else {
                $map3['logo_id'] = array('eq', $logo_id);
            }
        }
        $product_id = \db('product')
            ->alias('a')
            ->join('logo b', 'b.id=a.logo_id')
            ->join('class_con d', 'd.id=a.class_con_id')
            ->join('classa c', 'c.id=a.class_id')
            ->field('a.id,a.avatar,d.class_con,a.name,c.class,b.logo,a.fengzhuang,a.con,a.stock,a.book_avatar,a.tidu1,a.price1,a.tidu2,a.price2,a.tidu3,a.price3,a.tidu4,a.price4,a.tidu5,a.price5')
            ->where($map1)
            ->where($map2)
            ->where($map3)
            ->page($param['pages'], $param['rows'])
            ->select();
        if (empty($product_id)) {
            $return['count'] = [];
            $return['list'] = [];
            $this->success('成功', $return);
            die;
        }
        foreach ($product_id as $k => $v) {
            $lists[$k] = $this->product_arr($v['id']);
        }
        $list = $this->three_arr($lists);
        $count = \db('product')
            ->alias('a')
            ->join('logo b', 'b.id=a.logo_id')
            ->join('class_con d', 'd.id=a.class_con_id')
            ->join('classa c', 'c.id=a.class_id')
            ->field('a.id,a.avatar,d.class_con,a.name,c.class,b.logo,a.fengzhuang,a.con,a.stock,a.book_avatar,a.tidu1,a.price1,a.tidu2,a.price2,a.tidu3,a.price3,a.tidu4,a.price4,a.tidu5,a.price5')
            ->where($map1)
            ->where($map2)
            ->where($map3)
            ->select();
        foreach ($product_id as $k1 => $v1) {
            $list[$k1]['avatar'] = cdnurl($v1['avatar'], true);
            $list[$k1]['book_con'] = cdnurl($v1['book_avatar'], true);
        }
        foreach ($list as $k => $v) {
            $list[$k]['number'] = 100;
        }
        $return['count'] = count($count);
        $return['num_count'] = ceil($return['count'] / $param['rows']);
        $return['list'] = $list;
        $this->success('成功', $return);
    }
wangzhi authored
1200
}