|
|
@@ -6,6 +6,7 @@ use app\common\controller\Api;
|
|
|
use app\common\model\ProductTransfer;
|
|
|
use app\common\model\ProductOrder;
|
|
|
use app\common\model\ProductPopular;
|
|
|
+use app\common\model\ProductArea;
|
|
|
use app\common\model\ProductLists;
|
|
|
use app\common\model\LedgerWalletModel;
|
|
|
use app\common\model\UserArea;
|
|
|
@@ -25,7 +26,7 @@ class Order extends Api
|
|
|
/**
|
|
|
* 创建订单
|
|
|
*/
|
|
|
- public function create(ProductPopular $productPopular, ProductOrder $productOrder, ProductLists $productLists, LedgerWalletModel $ledgerWalletModel)
|
|
|
+ public function create(ProductPopular $productPopular, ProductOrder $productOrder, ProductArea $productArea, LedgerWalletModel $ledgerWalletModel)
|
|
|
{
|
|
|
$params = $this->request->post();
|
|
|
$validate = \think\Loader::validate('Order');
|
|
|
@@ -53,7 +54,7 @@ class Order extends Api
|
|
|
$productOrder->create($order_data);
|
|
|
|
|
|
//修改区域状态
|
|
|
- $productLists->where('id', $order_data['area_id'])->update(['status'=> $productLists::STOP]);
|
|
|
+ $productArea->where('id', $order_data['area_id'])->update(['status'=> ProductLists::STOP]);
|
|
|
|
|
|
//余额记录
|
|
|
$ledgerWalletModel->changeWalletAccount($this->auth->id, Asset::TOKEN, -$order_info['price'], $ledgerWalletModel::Popular, $this->auth->id);
|
|
|
@@ -318,7 +319,7 @@ class Order extends Api
|
|
|
'tx_hash' => $tx_hash,
|
|
|
'from_address' => $this->auth->address,
|
|
|
'to_address' => Env::get('rental.pay_address'),
|
|
|
- 'cha_bao' => Config::get('chabao_rate') * $amount
|
|
|
+ 'cha_bao' => getConfig('chabao_rate') * $amount
|
|
|
]);
|
|
|
// 提交事务
|
|
|
Db::commit();
|