| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- <?php
- namespace app\home\controller;
- use think\Lang;
- use think\Cache;
- use think\Request;
- use think\Controller;
- use think\Validate;
- /**
- * 主页管理类
- */
- class Product extends Common
- {
- /**
- * 构造函数
- *
- * @access public
- */
- public function __construct()
- {
- parent::__construct();
- }
- /**
- * 产品与服务
- *
- * @access public
- * @return array JsonString
- */
- public function product()
- {
- $fatherProductField = [
- 'product_name',
- 'product_content',
- 'product_img',
- 'product_id',
- ];
- $fatherProductWhere = [
- 'product_pid' => 0,
- ];
- $getFatherProduct = model('Product')->getSelect($fatherProductField, $fatherProductWhere);
- $this->assign('fatherProduct', $getFatherProduct);
- $id = input('get.id') ?? $getFatherProduct[0]->product_id;
- $productWhere = [
- 'product_pid' => $id,
- ];
- $getProduct = model('Product')->getSelect($fatherProductField, $productWhere);
- $this->assign('product', $getProduct);
- $this->assign('id', $id);
- return $this->fetch();
- }
- /**
- * 产品与服务详情
- *
- * @access public
- * @return array JsonString
- */
- public function details()
- {
- $findProductinfo = model('Productinfo')->getFind();
- $id = input('get.id') ?? $findProductinfo->product_id;
- $productWhere = [
- 'product_id' => $id,
- ];
- $getProductInfo = model('Productinfo')->getSelect($productWhere);
- $this->assign('productInfo', $getProductInfo);
- $getProduct = model('Product')->getFind($productWhere);
- $this->assign('product', $getProduct);
- $getRenewal = model('Renewal')->getRenewal();
- $this->assign('renewal', $getRenewal);
- return $this->fetch();
- }
- }
|