chengkun
2025-06-05 4080b5997b38ca84b3b203c7101dcadb97b76925
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<?php
 
namespace app\home\controller;
 
use app\supplier\model\Goods as GoodsModel;
use think\facade\Db;
use think\facade\View;
use think\facade\Request;
use app\BaseController;
 
class Index extends BaseController {
    public function index() {
        return View::fetch('index');
    }
    
    public function talent() {
        return View::fetch();
    }
    
    public function test() {
        return View::fetch();
    }
    
    public function test1() {
        return View::fetch();
    }
    
    public function getGoodsList() {
        try {
            if (!Request::isPost()) {
                throw new Exception(lang('request_method_incorrect'));
            }
            $condition[] = ['g.status', '=', 1];
            $condition[] = ['g.is_show', '=', 1];
            $order = 'g.id asc';
            $list = GoodsModel::alias('g')
                ->join('goods_desc gd', 'g.id=gd.goods_id')
                ->field("g.id,g.supplier_goods_code,g.status,gd.goods_title_cn,gd.goods_title_en,(select url from web_goods_picture where goods_id=g.id order by id asc limit 1) as picture")->where($condition)->order($order)->limit(18)->select()->toArray();
            if (!$list) {
                $list = [];
            } else {
                foreach ($list as $key => $value) {
                    $list[$key]['picture'] = get_img_url($value['picture']);
                }
            }
            $result['list'] = $list;
            return $this->successResponse($result);
        } catch (Exception $exc) {
            return $this->errorResponse($exc->getMessage());
        }
    }
    
    public function getBigvList() {
        try {
            if (!Request::isPost()) {
                throw new Exception(lang('request_method_incorrect'));
            }
            $condition[] = ['BIGV.is_show', '=', 1];
            $order = 'BIGV.id asc';
            $list = Db::name('seller_bigv_info')->alias('BIGV')
                ->join('seller_base_info SBI', 'SBI.seller_id=BIGV.seller_id')
                ->field("BIGV.*,SBI.first_name")->withAttr('personal_images', function ($value) {
                    return json_decode($value, TRUE);
                })->where($condition)->order($order)->limit(6)->select()->toArray();
            if (!$list) {
                $list = [];
            }
            $result['list'] = $list;
            return $this->successResponse($result);
        } catch (Exception $exc) {
            return $this->errorResponse($exc->getMessage());
        }
    }
    
    public function getSchoolList() {
        try {
            if (!Request::isPost()) {
                throw new Exception(lang('request_method_incorrect'));
            }
            $order = 'order_id asc,id asc';
            $list = Db::name('partner_school')->field("*")->order($order)->limit(30)->select()->toArray();
            if (!$list) {
                $list = [];
            }
            $result['list'] = $list;
            return $this->successResponse($result);
        } catch (Exception $exc) {
            return $this->errorResponse($exc->getMessage());
        }
    }
    
    public function getSalesPlatformList() {
        try {
            if (!Request::isPost()) {
                throw new Exception(lang('request_method_incorrect'));
            }
            $condition[] = ['is_show', '=', 1];
            $order = 'order_id asc,id asc';
            $list = Db::name('sales_platform')->field("*")->where($condition)->order($order)->limit(6)->select()->toArray();
            if (!$list) {
                $list = [];
            }
            else{
                foreach ($list as $key => $value) {
                    $list[$key]['logo'] = get_img_url($value['logo']);
                }
            }
            $result['list'] = $list;
            return $this->successResponse($result);
        } catch (Exception $exc) {
            return $this->errorResponse($exc->getMessage());
        }
    }
    
}