|
|
@@ -9,56 +9,17 @@ use bizHd\goods\services\CategoryService;
|
|
|
use bizHd\goods\services\GoodsCategoryService;
|
|
|
use bizHd\goods\services\GoodsSettingService;
|
|
|
use bizHd\saas\services\FestRiseService;
|
|
|
-use common\components\dict;
|
|
|
-use common\components\mtUtil;
|
|
|
use common\components\printUtil;
|
|
|
use Yii;
|
|
|
use common\components\util;
|
|
|
use bizHd\goods\services\GoodsService;
|
|
|
use bizHd\order\services\OrderService;
|
|
|
-use Shishaoqi\MeituanFlashPurchase\Application;
|
|
|
|
|
|
class GoodsController extends BaseController
|
|
|
{
|
|
|
|
|
|
public $guestAccess = ['detail'];
|
|
|
|
|
|
- public function actionSetSh()
|
|
|
- {
|
|
|
- $get = Yii::$app->request->get();
|
|
|
- $id = $get['id'] ?? 0;
|
|
|
- $goods = GoodsClass::getById($id, true);
|
|
|
- if (empty($goods)) {
|
|
|
- util::fail('没有找到商品');
|
|
|
- }
|
|
|
- GoodsClass::valid($goods, $this->mainId);
|
|
|
- $goods->sh = 1;
|
|
|
- $goods->save();
|
|
|
- $spu = $goods->spu ?? '';
|
|
|
- if (empty($spu)) {
|
|
|
- util::fail('非美团商品');
|
|
|
- }
|
|
|
- $shopId = $this->shopId ?? 0;
|
|
|
- $ext = ShopExtClass::getByCondition(['shopId' => $shopId], true);
|
|
|
- if (empty($ext)) {
|
|
|
- util::fail('没有找到门店拓展信息');
|
|
|
- }
|
|
|
- $appSpuCode = $goods->spu ?? '';
|
|
|
- if (empty($appSpuCode)) {
|
|
|
- util::fail('商品有问题');
|
|
|
- }
|
|
|
-
|
|
|
- $config = dict::getDict('mtConfig');
|
|
|
- $app = new Application($config);
|
|
|
- $accessToken = mtUtil::getAccessToken($ext);
|
|
|
-
|
|
|
- $params = ['app_poi_code' => $shopId, 'app_spu_code' => $appSpuCode, 'access_token' => $accessToken, 'skus' => '[{isSh:1}]'];
|
|
|
- $r = $app->retail->initData($params);
|
|
|
- print_r($r);
|
|
|
-
|
|
|
- util::complete();
|
|
|
- }
|
|
|
-
|
|
|
//商品打印 ssh 20220602
|
|
|
public function actionPrint()
|
|
|
{
|