| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126 |
- <?php
- /**
- * 重庆赤晓店信息科技有限公司
- * https://www.chixiaodian.com
- * Copyright (c) 2023 赤店商城 All rights reserved.
- */
- namespace app\modules\admin\controllers\keloop;
- use app\models\Store;
- use app\models\Option;
- use app\models\Order;
- use app\constants\OptionSetting;
- use app\modules\admin\models\keloop\KeloopForm;
- /**
- * Class GoodsController
- * @package app\modules\admin\controllers
- */
- class IndexController extends BaseController
- {
- public $supplier_id = 0;
- public function actionTest() {
- // $res = KeloopForm::getFundUrl(84, ['shop_id' => '1']);
- $delivery_res = KeloopForm::order_created(84, 12292);
- $order = Order::findOne(12080);
- $addr = json_decode($order->address_data, true);
- $getFee = KeloopForm::getFee(84, $addr['longitude'], $addr['latitude']);
- $getCouriers = KeloopForm::getCouriers(84);
- $getMerchants = KeloopForm::getMerchants(84);
- $getTeamInfo = KeloopForm::getTeamInfo(84);
- $getFundUrl = KeloopForm::getFundUrl(84);
- return $this->asJson([$delivery_res, $getFee, $getTeamInfo, $getFundUrl, $getCouriers, $getMerchants]);
- }
- public function actionConf() {
- $store_id = get_store_id();
- $conf = KeloopForm::conf($store_id);
- $getFundUrl = KeloopForm::getFundUrl($store_id);
- return $this->asJson([
- 'code' => 0,
- 'data' => [
- 'conf' => $conf,
- 'getFundUrl' => $getFundUrl,
- '$getTeamInfo' => KeloopForm::getTeamInfo($store_id),
- '$getCouriers' => KeloopForm::getCouriers($store_id),
- '$getMerchants' => KeloopForm::getMerchants($store_id),
- ],
- ]);
- }
- public function actionConfSave(){
- $store_id = get_store_id();
- $conf = input_params('conf');
- if(!is_array($conf)){
- $conf = json_decode($conf, true);
- }
- $res = [];
- KeloopForm::saveConf($store_id, $conf, $res);
- return $this->asJson($res);
- }
-
- public function actionOrderList() {
- $store_id = get_store_id();
- $params = all_params();
- $res = KeloopForm::orderList($store_id, $params);
- return $this->asJson($res);
- }
-
- public function actionOrderErrList() {
- $store_id = get_store_id();
- $res = KeloopForm::orderErrList($store_id);
- return $this->asJson($res);
- }
-
- public function actionOrderErrRecreate() {
- $store_id = get_store_id();
- $id = input_params('id');
- $res = KeloopForm::orderErrRecreate($store_id, $id);
- return $this->asJson($res);
- }
-
- public function actionOrderFee() {
- $store_id = get_store_id();
- $order_id = input_params('order_id');
- $res = KeloopForm::orderFee($store_id, $order_id);
- return $this->asJson($res);
- }
-
- public function actionOrderCancel() {
- $store_id = get_store_id();
- $order_id = input_params('order_id');
- $reason = input_params('reason');
- $res = KeloopForm::order_canceled($store_id, $order_id, $reason, 2);
- return $this->asJson($res);
- }
-
- public function actionMealOutOrder() {
- $store_id = get_store_id();
- $trade_no = input_params('trade_no');
- $res = KeloopForm::mealOutOrder($store_id, $trade_no, time());
- return $this->asJson($res);
- }
-
- public function actionGetOrderInfo() {
- $store_id = get_store_id();
- $trade_no = input_params('trade_no');
- $res = KeloopForm::getOrderInfo($store_id, $trade_no, 0);
- return $this->asJson($res);
- }
-
- public function actionGetCourierTag() {
- $store_id = get_store_id();
- $trade_no = input_params('trade_no');
- $res = KeloopForm::getCourierTag($store_id, $trade_no);
- return $this->asJson($res);
- }
-
- public function actionGetOrderLog() {
- $store_id = get_store_id();
- $trade_no = input_params('trade_no');
- $res = KeloopForm::getOrderLog($store_id, $trade_no);
- return $this->asJson($res);
- }
- }
|