|
@@ -91,7 +91,7 @@ class Order extends Base
|
|
|
*/
|
|
|
public function create()
|
|
|
{
|
|
|
- $productId = $this->request->post('id', 0);
|
|
|
+ $productId = input('id', 0);
|
|
|
|
|
|
try {
|
|
|
$user_id = $this->auth->id;
|
|
@@ -101,11 +101,11 @@ class Order extends Base
|
|
|
$productId = \addons\unishop\extend\Hashids::decodeHex($productId);
|
|
|
$product = (new Product)->where(['id' => $productId, 'switch' => Product::SWITCH_ON, 'deletetime' => null])->find();
|
|
|
/** 产品基础数据 **/
|
|
|
- $spec = $this->request->post('spec', '');
|
|
|
+ $spec = input('spec', '');
|
|
|
$productData[0] = $product->getDataOnCreateOrder($spec);
|
|
|
} else {
|
|
|
// 多个商品
|
|
|
- $cart = $this->request->post('cart');
|
|
|
+ $cart = input('cart');
|
|
|
$carts = (new \addons\unishop\model\Cart)
|
|
|
->whereIn('id', $cart)
|
|
|
->with(['product'])
|
|
@@ -190,7 +190,7 @@ class Order extends Base
|
|
|
*/
|
|
|
public function submit()
|
|
|
{
|
|
|
- $data = $this->request->post();
|
|
|
+ $data = input();
|
|
|
try {
|
|
|
$validate = Loader::validate('\\addons\\unishop\\validate\\Order');
|
|
|
if (!$validate->check($data, [], 'submit')) {
|
|
@@ -241,7 +241,7 @@ class Order extends Base
|
|
|
*/
|
|
|
public function getDelivery()
|
|
|
{
|
|
|
- $cityId = $this->request->get('city_id', 0);
|
|
|
+ $cityId = input('city_id', 0);
|
|
|
$delivery = (new DeliveryRuleModel())->getDelivetyByArea($cityId);
|
|
|
$this->success('', $delivery['list']);
|
|
|
}
|
|
@@ -287,9 +287,9 @@ class Order extends Base
|
|
|
public function getOrders()
|
|
|
{
|
|
|
// 0=全部,1=待付款,2=待发货,3=待收货,4=待评价,5=售后
|
|
|
- $type = $this->request->get('type', 0);
|
|
|
- $page = $this->request->get('page', 1);
|
|
|
- $pagesize = $this->request->get('pagesize', 10);
|
|
|
+ $type = input('type', 0);
|
|
|
+ $page = input('page', 1);
|
|
|
+ $pagesize = input('pagesize', 10);
|
|
|
try {
|
|
|
|
|
|
$orderModel = new \addons\unishop\model\Order();
|
|
@@ -314,7 +314,7 @@ class Order extends Base
|
|
|
*/
|
|
|
public function cancel()
|
|
|
{
|
|
|
- $order_id = $this->request->get('order_id', 0);
|
|
|
+ $order_id = input('order_id', 0);
|
|
|
$order_id = \addons\unishop\extend\Hashids::decodeHex($order_id);
|
|
|
|
|
|
$orderModel = new \addons\unishop\model\Order();
|
|
@@ -356,7 +356,7 @@ class Order extends Base
|
|
|
*/
|
|
|
public function delete()
|
|
|
{
|
|
|
- $order_id = $this->request->get('order_id', 0);
|
|
|
+ $order_id = input('order_id', 0);
|
|
|
$order_id = \addons\unishop\extend\Hashids::decodeHex($order_id);
|
|
|
|
|
|
$orderModel = new \addons\unishop\model\Order();
|
|
@@ -390,7 +390,7 @@ class Order extends Base
|
|
|
*/
|
|
|
public function received()
|
|
|
{
|
|
|
- $order_id = $this->request->get('order_id', 0);
|
|
|
+ $order_id = input('order_id', 0);
|
|
|
$order_id = \addons\unishop\extend\Hashids::decodeHex($order_id);
|
|
|
|
|
|
$orderModel = new \addons\unishop\model\Order();
|
|
@@ -426,12 +426,12 @@ class Order extends Base
|
|
|
*/
|
|
|
public function comment()
|
|
|
{
|
|
|
- $rate = $this->request->post('rate', 5);
|
|
|
- $anonymous = $this->request->post('anonymous', 0);
|
|
|
- $comment = $this->request->post('comment');
|
|
|
- $order_id = $this->request->post('order_id', 0);
|
|
|
+ $rate = input('rate', 5);
|
|
|
+ $anonymous = input('anonymous', 0);
|
|
|
+ $comment = input('comment');
|
|
|
+ $order_id = input('order_id', 0);
|
|
|
$order_id = \addons\unishop\extend\Hashids::decodeHex($order_id);
|
|
|
- $product_id = $this->request->post('product_id');
|
|
|
+ $product_id = input('product_id');
|
|
|
$product_id = \addons\unishop\extend\Hashids::decodeHex($product_id);
|
|
|
|
|
|
$orderProductModel = new \addons\unishop\model\OrderProduct();
|
|
@@ -589,7 +589,7 @@ class Order extends Base
|
|
|
*/
|
|
|
public function detail()
|
|
|
{
|
|
|
- $order_id = $this->request->get('order_id', 0);
|
|
|
+ $order_id = input('order_id', 0);
|
|
|
$order_id = \addons\unishop\extend\Hashids::decodeHex($order_id);
|
|
|
|
|
|
try {
|
|
@@ -690,7 +690,7 @@ class Order extends Base
|
|
|
*/
|
|
|
public function refundInfo()
|
|
|
{
|
|
|
- $order_id = $this->request->post('order_id');
|
|
|
+ $order_id = input('order_id');
|
|
|
$order_id = \addons\unishop\extend\Hashids::decodeHex($order_id);
|
|
|
|
|
|
$orderModel = new \addons\unishop\model\Order();
|
|
@@ -749,7 +749,7 @@ class Order extends Base
|
|
|
*/
|
|
|
public function refund()
|
|
|
{
|
|
|
- $order_id = $this->request->post('order_id');
|
|
|
+ $order_id = input('order_id');
|
|
|
$order_id = Hashids::decodeHex($order_id);
|
|
|
$orderModel = new \addons\unishop\model\Order();
|
|
|
$order = $orderModel->where(['id' => $order_id, 'user_id' => $this->auth->id])->find();
|
|
@@ -761,12 +761,12 @@ class Order extends Base
|
|
|
$this->error(__('订单未支付,可直接取消,无需申请售后'));
|
|
|
}
|
|
|
|
|
|
- $amount = $this->request->post('amount', 0);
|
|
|
- $serviceType = $this->request->post('service_type');
|
|
|
- $receivingStatus = $this->request->post('receiving_status');
|
|
|
- $reasonType = $this->request->post('reason_type');
|
|
|
- $refundExplain = $this->request->post('refund_explain');
|
|
|
- $orderProductId = $this->request->post('order_product_id');
|
|
|
+ $amount = input('amount', 0);
|
|
|
+ $serviceType = input('service_type');
|
|
|
+ $receivingStatus = input('receiving_status');
|
|
|
+ $reasonType = input('reason_type');
|
|
|
+ $refundExplain = input('refund_explain');
|
|
|
+ $orderProductId = input('order_product_id');
|
|
|
|
|
|
if (!$orderProductId) {
|
|
|
$this->error(__('Please select goods'));
|
|
@@ -833,8 +833,8 @@ class Order extends Base
|
|
|
*/
|
|
|
public function refundDelivery()
|
|
|
{
|
|
|
- $orderId = $this->request->post('order_id');
|
|
|
- $expressNumber = $this->request->post('express_number');
|
|
|
+ $orderId = input('order_id');
|
|
|
+ $expressNumber = input('express_number');
|
|
|
|
|
|
if (!$expressNumber) {
|
|
|
$this->error(__('Please fill in the express number'));
|
|
@@ -883,7 +883,7 @@ class Order extends Base
|
|
|
*/
|
|
|
public function express() {
|
|
|
|
|
|
- $params = $this->request->post();
|
|
|
+ $params = input();
|
|
|
if (!class_exists(\addons\expressquery\library\Expressquery::class)) {
|
|
|
$this->error('请先安装插件《物流信息接口》', []);
|
|
|
}
|