Răsfoiți Sursa

花材列表

shish 2 ani în urmă
părinte
comite
a0157152ab

+ 22 - 1
app-ghs/controllers/TestController.php

@@ -22,6 +22,27 @@ class TestController extends BaseController
 
     public $guestAccess = ['inform', 'notice', 'order-query', 'add-order', 'index', 'get'];
 
+    public function actionApply()
+    {
+        $sjNo ='';
+
+        $merchantPrivateKeyPath = Yii::getAlias("@vendor/lakala") . '/production/api_private_key.pem';
+        $lklCertificatePath = Yii::getAlias("@vendor/lakala") . '/production/lkl-apigw-v1.cer';
+        $params = [
+            'appid' => 'OP00002119',
+            'serial_no' => '018b08cfddbd',
+            'merchant_no' => $sjNo,
+            'term_no' => 'C6337694',
+            'merchantPrivateKeyPath' => $merchantPrivateKeyPath,
+            'lklCertificatePath' => $lklCertificatePath,
+        ];
+        $data = [
+
+        ];
+        $laResource = new Lakala($params);
+        $response = $laResource->applyInviteClear($data);
+    }
+
     public function actionGet()
     {
         ini_set('memory_limit', '2045M');
@@ -49,7 +70,7 @@ class TestController extends BaseController
             //['name' => '杭州斗南(没用)', 'merchantNo' => '8223310599200AD', 'wx' => [601254682, 601250805], 'zfb' => '2088820782666872'],
             ['name' => '买手很忙', 'merchantNo' => '8227310599200GJ', 'wx' => [601597167, 601595526], 'zfb' => '2088820818930267'],
             ['name' => '七彩花都OK', 'merchantNo' => '8227310599200GF', 'wx' => [601176481, 601148503], 'zfb' => '2088820748594478'],
-            ['name' => '十年OK', 'merchantNo' => '82252305992001U', 'wx' => [601285154, 601261795], 'zfb' => '2088820782171763'],
+            //['name' => '十年OK', 'merchantNo' => '82252305992001U', 'wx' => [601285154, 601261795], 'zfb' => '2088820782171763'],
             //['name' => '都市花季OK', 'merchantNo' => '82239305992006U', 'wx' => [601174342, 601147649], 'zfb' => '2088820748507346'],
             //['name' => '花样年华OK', 'merchantNo' => '82260205992007Q', 'wx' => [601134352, 601091710], 'zfb' => '2088820735043444'],
             //['name' => '精茂城OK', 'merchantNo' => '8225840599200TF', 'wx' => [601173752, 601143352], 'zfb' => '2088820746800005'],

+ 23 - 0
app-mall/controllers/ItemController.php

@@ -17,6 +17,29 @@ class ItemController extends BaseController
 
     public $guestAccess = ['show-info'];
 
+    public function actionAll()
+    {
+        $where = [];
+        $where['mainId'] = $this->mainId;
+        $classId = Yii::$app->request->get('classId', 0);
+        if (!empty($classId)) {
+            $where['classId'] = $classId;
+        }
+        $status = Yii::$app->request->get('status', 0);
+        if (!empty($status)) {
+            $where['status'] = $status;
+        }
+        $delStatus = Yii::$app->request->get('delStatus', 0);
+        if ($delStatus != 2) {
+            $where['delStatus'] = $delStatus;
+        }
+        //输出标准会员价,即批发价,默认显示的是批发价
+        $level = 0;
+        $data = ProductClass::getAllByCondition($where, ['actualSold' => SORT_DESC, 'inTurn' => SORT_DESC], "*");
+        $data = ProductClass::groupProductInfo($data, $level);
+        util::success(['list' => $data]);
+    }
+
     //散客查看花材详情 ssh 20230109
     public function actionGetMallItemInfo()
     {

+ 28 - 0
common/components/lakala/Lakala.php

@@ -3,6 +3,7 @@
 namespace common\components\lakala;
 
 use common\components\noticeUtil;
+use common\components\stringUtil;
 
 class Lakala
 {
@@ -17,6 +18,33 @@ class Lakala
     private $version = '3.0';
     private $preUrl = '';
 
+    //申请主动结算 ssh
+    public function applyInviteClear($params)
+    {
+        $subMerchantId = $params['subMerchantId'];
+        $tradeMode = $params['tradeMode'];
+        $arr = [
+            'tradeMode' => $tradeMode,
+            'merchantNo' => $this->merchant_no,
+            'subMerchantId' => $subMerchantId,
+            'orderNo' => $orderNo,
+            //机构代号
+            'orgCode' => '970936',
+            'version' => 'v1.0.0',
+        ];
+        $rand = time() . '_' . stringUtil::charsShuffle(22);
+        $baseRequestVO = [
+            'reqData' => $arr,
+            'timestamp' => time(),
+            'reqId' => $rand,
+            'ver' => '1.0.0',
+        ];
+        $body = json_encode($baseRequestVO, JSON_UNESCAPED_UNICODE);
+        $authorization = $this->getAuthorization($body);
+        $url = 'https://s2.lakala.com/api/v2/mms/sme/mrchAuthStateQuery';
+        return $this->post($url, $body, $authorization);
+    }
+
     public function __construct($params)
     {
         $this->appid = $params['appid'] ?? '';