This commit is contained in:
2022-09-09 16:24:11 +08:00
parent 756b760849
commit af2304dece
2 changed files with 32 additions and 0 deletions

22
app/controller/Order.php Normal file
View File

@@ -0,0 +1,22 @@
<?php
namespace app\controller;
class Order
{
public function create()
{
$userid = $GLOBALS['data']['userid'];
$order = \app\model\Order::create([
'student_id' => 1,
'user_id' => $userid,
'amount' => 15,
'type' => 1,
'status' => 0,
]);
return show("订单创建成功!", SUCCESS_CODE, $order->id);
}
}

10
app/model/Order.php Normal file
View File

@@ -0,0 +1,10 @@
<?php
namespace app\model;
use think\Model;
class Order extends Model
{
}