|
|
@@ -5,12 +5,35 @@ namespace console\controllers;
|
|
|
use biz\shop\classes\ShopClass;
|
|
|
use biz\stat\classes\StatRefundClass;
|
|
|
use bizGhs\order\classes\RefundOrderClass;
|
|
|
+use bizGhs\order\models\RefundOrder;
|
|
|
use yii\console\Controller;
|
|
|
use Yii;
|
|
|
|
|
|
class RefundController extends Controller
|
|
|
{
|
|
|
|
|
|
+ public function actionStatus()
|
|
|
+ {
|
|
|
+ $query = new \yii\db\Query();
|
|
|
+ $query->from(RefundOrder::tableName());
|
|
|
+ $query->where(['>', 'id', 0]);
|
|
|
+ $query->orderBy('addTime ASC');
|
|
|
+ foreach ($query->batch() as $batchOrder) {
|
|
|
+ foreach ($batchOrder as $refund) {
|
|
|
+ $connection = Yii::$app->db;
|
|
|
+ $transaction = $connection->beginTransaction();
|
|
|
+ try {
|
|
|
+ print_r($refund);
|
|
|
+ die;
|
|
|
+ $transaction->commit();
|
|
|
+ } catch (\Exception $e) {
|
|
|
+ $transaction->rollBack();
|
|
|
+ $msg = $e->getMessage();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
//退款数据更新 ./yii refund/update
|
|
|
public function actionUpdate()
|
|
|
{
|