123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208 |
- <?php
- namespace Shop\Src;
- use Dever;
- use Main\Lib\Core;
- class Main extends Core
- {
- public function __construct()
- {
- parent::__construct();
-
- }
- public function test()
- {
-
- $param = array
- (
- 'project_id' => 1,
- 'channel_id' => 1,
- 'system_source' => 5,
- 'order_id' => Dever::input('order_id', 'G202112297347788956443487'),
- 'refund_cash' => Dever::input('cash', '1'),
- 'refund_order_id' => Dever::input('refund_order_id', '1'),
- );
- $result = Dever::load('pay/api.refund', $param);
- print_r($result);die;
- $data = array
- (
- 'character_string6' => array
- (
- 'value' => '111111112',
- ),
- 'phrase7' => array
- (
- 'value' => '已发货',
- ),
- 'thing8' => array
- (
- 'value' => '货号',
- ),
- 'amount1' => array
- (
- 'value' => '100元',
- ),
- 'thing5' => array
- (
- 'value' => '提示',
- ),
- );
- $data = array
- (
- 'thing3' => array
- (
- 'value' => '111111112',
- ),
- 'thing6' => array
- (
- 'value' => date('Y-m-d H:i:s'),
- ),
- 'thing7' => array
- (
- 'value' => '提示',
- ),
- );
- $data = Dever::json_encode($data);
- return $data;
- }
-
- public function user()
- {
- $this->data['user'] = $this->user;
- $this->data['config'] = Dever::db('main/config')->find();
- return $this->data;
- }
-
- public function getSubscribeTemplate()
- {
- $this->data['template'] = Dever::load('wechat_applet/subscribe')->getList();
- return $this->data;
- }
-
- public function shop()
- {
- $id = Dever::input('id');
- $this->data['shop'] = Dever::db('shop/info')->find($id);
- if ($this->data['shop']) {
- unset($this->data['shop']['goods']);
- unset($this->data['shop']['factory']);
- unset($this->data['shop']['store']);
- }
- return $this->data;
- }
-
-
- public function home()
- {
- $city = Dever::input('city');
- $lng = Dever::input('lng');
- $lat = Dever::input('lat');
-
- $this->data['shop'] = array();
- if ($city && $lng && $lat) {
- $this->data['shop'] = Dever::load('shop/lib/info')->get($city, $lng, $lat);
- }
-
- $this->data['focus'] = Dever::load('push/lib/data')->get('home_focus', '首页焦点图', 5);
-
- $this->data['act'] = Dever::load('push/lib/data')->get('home_act', '首页活动推荐', 3);
-
- $this->data['hot'] = Dever::load('push/lib/data')->get('home_hot', '首页热门商品', 6);
-
- $this->data['top'] = Dever::load('push/lib/data')->get('home_top', '首页推荐商品', 6);
-
- $this->data['alert'] = Dever::load('push/lib/data')->get('home_alert', '首页弹窗', 1);
- return $this->data;
- }
-
- public function getShop()
- {
- $city = Dever::input('city');
- $lng = Dever::input('lng');
- $lat = Dever::input('lat');
- $name = Dever::input('name');
- $shop_id = Dever::input('shop_id');
- $address = Dever::input('address');
-
- $this->data['shop'] = array();
- if ($city) {
- $this->data['shop'] = Dever::load('shop/lib/info')->get($city, $lng, $lat, $name, 'fetchAll', $shop_id, $address);
- }
- return $this->data;
- }
-
- public function getShopOne()
- {
- $city = Dever::input('city');
- $lng = Dever::input('lng');
- $lat = Dever::input('lat');
- $name = Dever::input('name');
- $shop_id = Dever::input('shop_id');
- $address = Dever::input('address');
-
- $this->data['shop'] = array();
- if ($city) {
- $this->data['shop'] = Dever::load('shop/lib/info')->get($city, $lng, $lat, $name, 'fetch', $shop_id, $address);
- }
- return $this->data;
- }
-
- public function getGoods()
- {
- return Dever::load('shop/lib/goods')->getList();
- }
-
- public function news()
- {
- $id = Dever::input('id');
- $this->data['news'] = Dever::load('content/lib/news')->get($id);
- return $this->data;
- }
-
- public function feature()
- {
- $id = Dever::input('id');
- $this->data['feature'] = Dever::load('content/lib/feature')->get($id);
- return $this->data;
- }
-
- public function getShopByType()
- {
- $where['type'] = 10;
- return Dever::db('shop/info')->getDataByType($where);
- }
- }
|