Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 48772f0

Browse files
committed
order v1 finish
1 parent c2f8bc7 commit 48772f0

10 files changed

+2149
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/.idea/
2+
/vendor/

README.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,65 @@
11
# laravel-order
22
laravel 框架中的 order 组件。
3+
4+
# 安装
5+
6+
可以直接在命令行中安装:
7+
8+
composer require "rayjun/laravel-order:1.0.*"
9+
10+
或者可以在你项目中 `composer.json` 中加入以下代码:
11+
12+
"require": {
13+
"rayjun/laravel-order": "1.0.*"
14+
}
15+
16+
然后再执行:
17+
18+
composer update
19+
20+
在完成上面的安装之后,可以在 `config/app.php` 中的 `providers` 数组中增加以下代码:
21+
22+
'Rayjun\LaravelOrder\LaravelOrderServiceProvider'
23+
24+
然后增加一行到
25+
26+
'Order' => 'Rayjun\LaravelOrder\Facades\Order',
27+
28+
29+
# 使用
30+
31+
## 创建一个订单
32+
33+
Order Order::order(array $items, int $user_id);
34+
35+
## 获取一个订单
36+
37+
Order Order::getOrder($order_id);
38+
39+
## 获取用户的订单
40+
41+
Collection Order::getUserOrders($user_id);
42+
43+
## 更改订单状态
44+
45+
boolean Order::updateStatus(int $order_id, string $status);
46+
47+
## 删除一个订单
48+
49+
boolean Order::delete(int $order_id);
50+
51+
## 更新订单项数量
52+
53+
boolean Order::updateQty(int $item_id, int qty);
54+
55+
## 计算订单总价格
56+
57+
float Order::total($order_id);
58+
59+
## 计算商品总数量
60+
61+
int Order::count($order_id);
62+
63+
## 更新订单商品数量和总价
64+
65+
boolean Order::updateOrder($order_id);

composer.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"name": "rayjun/laravel-order",
3+
"description": "Order for Laravel Application.",
4+
"keywords": [
5+
"order",
6+
"laravel"
7+
],
8+
"license": "MIT",
9+
"authors": [
10+
{
11+
"name": "rayjun",
12+
"email": "[email protected]"
13+
}
14+
],
15+
"require": {
16+
"illuminate/support": "5.0.*|5.1.*",
17+
"illuminate/config": "5.0.*|5.1.*",
18+
"illuminate/database": "5.0.*|5.1.*",
19+
"illuminate/console": "5.0.*|5.1.*"
20+
},
21+
"require-dev": {
22+
"phpunit/phpunit": "~4.0"
23+
},
24+
"minimum-stability": "dev",
25+
"autoload": {
26+
"psr-4": {
27+
"Rayjun\\LaravelOrder\\": "src"
28+
}
29+
}
30+
}

0 commit comments

Comments
 (0)