| 1234567891011121314151617181920212223242526272829303132333435363738 |
- <?php
- namespace ghs\controllers;
- use bizGhs\order\classes\OrderClearClass;
- use Yii;
- use common\components\util;
- class OrderClearController extends BaseController
- {
- //收款 ssh 2021.2.4
- public function actionClear()
- {
- $id = Yii::$app->request->post('id');
- $customId = Yii::$app->request->post('customId');
- if (empty($id)) {
- util::fail('请选择交易记录');
- }
- $connection = Yii::$app->db;
- $transaction = $connection->beginTransaction();
- $data = [
- 'customId' => $customId,
- 'ghsShopAdminId' => $this->shopAdminId,
- 'ghsShopAdminName' => $this->shopAdmin['name'],
- ];
- try {
- OrderClearClass::clear($data, $id, $this->sjId, $this->shopId);
- $transaction->commit();
- } catch (\Exception $exception) {
- $transaction->rollBack();
- Yii::info("批量收款失败:" . $exception->getMessage());
- util::fail('操作失败');
- }
- util::complete();
- }
- }
|