|
|
@@ -17,7 +17,7 @@ use app\common\model\UserBuying;
|
|
|
use fast\Action;
|
|
|
use fast\Asset;
|
|
|
use think\Db;
|
|
|
-use think\Exception;
|
|
|
+use Exception;
|
|
|
|
|
|
class Market extends Api
|
|
|
{
|
|
|
@@ -68,19 +68,15 @@ class Market extends Api
|
|
|
$params = $this->request->post();
|
|
|
$validate = \think\Loader::validate('Market');
|
|
|
if(!$validate->scene('transferlock')->check($params)) $this->error($validate->getError());
|
|
|
- Db::startTrans();
|
|
|
try {
|
|
|
|
|
|
$marketLogic::setTransferLock($productTransfer, config('market_transfer.lock_time'), $params['transfer_id']);
|
|
|
|
|
|
- // 提交事务
|
|
|
- Db::commit();
|
|
|
} catch (Exception $e) {
|
|
|
// 回滚事务
|
|
|
- Db::rollback();
|
|
|
- $this->error($e->getMessage(), null, $e->getCode());
|
|
|
+ $this->error($e->getMessage());
|
|
|
}
|
|
|
- $this->success('ok');
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|