|
|
@@ -540,12 +540,32 @@ class UserController extends BaseController {
|
|
|
foreach ($packages as $index => $package) {
|
|
|
$packages[$index]['LEVEL_NAME'] = $decLevels[$package['LEVEL_ID']]['LEVEL_NAME'] ?? '';
|
|
|
}
|
|
|
+
|
|
|
+// $query_condition = " AND (1<>1";
|
|
|
+// if(!$isDecReg || ($isDecReg && $isDec==1)){
|
|
|
+// $query_condition = " AND (FIND_IN_SET(1, S.GIFT_TYPE)>0";
|
|
|
+// }
|
|
|
+// if($isStudio==1){
|
|
|
+// $query_condition .= " OR FIND_IN_SET(3, S.GIFT_TYPE)>0";
|
|
|
+// }
|
|
|
+// $query_condition .= ") AND (S.INSTALMENT=0 OR S.INSTALMENT=1) AND N.COUNTRY_ID=:COUNTRY_ID";
|
|
|
+
|
|
|
+ // 只查询普通商品
|
|
|
+// $allGoods = ShopGoods::find()
|
|
|
+// ->alias('S')
|
|
|
+// ->select('S.*,N.MARKET_PRICE,N.SELL_PRICE,N.TAX_RATE,N.LOCAL_CURRENCY_ID,N.COUNTRY_ID,C.CODE')
|
|
|
+// ->join('INNER JOIN', ShopGoodsNature::tableName() . ' AS N', 'N.GOODS_ID=S.ID')
|
|
|
+// ->join('INNER JOIN', Currency::tableName() . ' AS C', 'C.ID=N.LOCAL_CURRENCY_ID')
|
|
|
+// ->where("STATUS=1 AND CATEGORY_TYPE=1 " . $query_condition, [':COUNTRY_ID' => $countryId])
|
|
|
+// ->orderBy('SORT ASC')
|
|
|
+// ->asArray()
|
|
|
+// ->all();
|
|
|
$goods = ShopGoods::find()
|
|
|
->alias('S')
|
|
|
->select('S.*,N.MARKET_PRICE,N.SELL_PRICE,N.TAX_RATE,N.LOCAL_CURRENCY_ID,N.COUNTRY_ID,C.CODE')
|
|
|
->innerJoin(ShopGoodsNature::tableName() . ' N', 'N.GOODS_ID=S.ID')
|
|
|
->innerJoin(Currency::tableName() . ' C', 'C.ID=N.LOCAL_CURRENCY_ID')
|
|
|
- ->where('S.STATUS=1 AND S.CATEGORY_TYPE=1 AND FIND_IN_SET(1,S.GIFT_TYPE)>0 AND N.COUNTRY_ID=:COUNTRY_ID', [':COUNTRY_ID' => $countryId])
|
|
|
+ ->where('S.STATUS=1 AND S.CATEGORY_TYPE=1 AND FIND_IN_SET(1,S.GIFT_TYPE)>0 AND (S.INSTALMENT=0 OR S.INSTALMENT=1) AND N.COUNTRY_ID=:COUNTRY_ID', [':COUNTRY_ID' => $countryId])
|
|
|
->orderBy('S.SORT ASC')
|
|
|
->asArray()->all();
|
|
|
|
|
|
@@ -572,11 +592,41 @@ class UserController extends BaseController {
|
|
|
'decLevel' => DeclarationLevel::getData(),
|
|
|
]);
|
|
|
} catch (\Throwable $e) {
|
|
|
- LoggerTool::error('guestDec failed: ' . get_class($e));
|
|
|
+ LoggerTool::error([
|
|
|
+ 'event' => 'guestDec_failed',
|
|
|
+ 'exception' => get_class($e),
|
|
|
+ 'message' => $e->getMessage(),
|
|
|
+ 'file' => basename($e->getFile()),
|
|
|
+ 'line' => $e->getLine(),
|
|
|
+ ]);
|
|
|
+ if ($e instanceof \yii\web\HttpException) {
|
|
|
+ return static::notice($e->getMessage(), $e->statusCode);
|
|
|
+ }
|
|
|
+ return static::notice('Unable to process guest order.', 500);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public function actionGuestDecDebugPaid()
|
|
|
+ {
|
|
|
+ try {
|
|
|
+ $input = Yii::$app->request->post();
|
|
|
+ $result = (new GuestDeclarationOrderService())->debugCompletePaidDraft(
|
|
|
+ (string) ($input['draftId'] ?? ''),
|
|
|
+ (string) ($input['accessToken'] ?? '')
|
|
|
+ );
|
|
|
+ return static::notice($result);
|
|
|
+ } catch (\Throwable $e) {
|
|
|
+ LoggerTool::error([
|
|
|
+ 'event' => 'guestDec_debug_paid_failed',
|
|
|
+ 'exception' => get_class($e),
|
|
|
+ 'message' => $e->getMessage(),
|
|
|
+ 'file' => basename($e->getFile()),
|
|
|
+ 'line' => $e->getLine(),
|
|
|
+ ]);
|
|
|
if ($e instanceof \yii\web\HttpException) {
|
|
|
return static::notice($e->getMessage(), $e->statusCode);
|
|
|
}
|
|
|
- return static::notice('Unable to process guest order.message:'.$e->getMessage().'trace:'.$e->getTrace(), 500);
|
|
|
+ return static::notice('Unable to debug-complete guest order.', 500);
|
|
|
}
|
|
|
}
|
|
|
|