grozzzny / westgate
Westgate 组件 for yii2 - westgate.market
dev-master
2020-03-23 15:30 UTC
Requires
- yiisoft/yii2: *
- yiisoft/yii2-httpclient: ~2.0.0
This package is auto-updated.
Last update: 2024-09-24 00:00:17 UTC
README
安装指南
$ php composer.phar require grozzzny/westgate "dev-master"
获取令牌
设置配置和令牌
\config\web.php
$config = [ ... 'components' => [ ... 'westgate' => [ 'class' => 'grozzzny\westgate\WestgateComponent', 'token' => 'qwertyuiop1234567890', //'itemObject' => 'main\models\ItemObject', //'categoryObject' => 'main\models\CategoryObject', //'orderObject' => 'main\models\OrderObject', ], ... ], ... ]; return $config;
示例
列出项目
$client = Yii::$app->westgate->itemIndexClient ->category($slug) ->search($search); $provider = new WestgateDataProvider(['client' => $client]);
查看订单
$client = Yii::$app->westgate->orderIndexClient->user(['email' => Yii::$app->user->identity->email]); $provider = new WestgateDataProvider(['client' => $client]);
获取内部信息
$inn = Yii::$app->westgate->passportInnClient ->passportParams($fio, $birthdate, $docnum, $docdt, $dcode) ->send();