|
@@ -243,7 +243,7 @@ class Order extends Base
|
|
|
*/
|
|
|
public function getDelivery()
|
|
|
{
|
|
|
- $cityId = $this->request->get('city_id', 0);
|
|
|
+ $cityId = $this->request->request('city_id', 0);
|
|
|
$delivery = (new DeliveryRuleModel())->getDelivetyByArea($cityId);
|
|
|
$this->success('', $delivery['list']);
|
|
|
}
|
|
@@ -289,9 +289,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 = $this->request->request('type', 0);
|
|
|
+ $page = $this->request->request('page', 1);
|
|
|
+ $pagesize = $this->request->request('listrow', 10);
|
|
|
try {
|
|
|
|
|
|
$orderModel = new \addons\unishop\model\Order();
|
|
@@ -316,7 +316,7 @@ class Order extends Base
|
|
|
*/
|
|
|
public function cancel()
|
|
|
{
|
|
|
- $order_id = $this->request->get('order_id', 0);
|
|
|
+ $order_id = $this->request->request('order_id', 0);
|
|
|
$order_id = \addons\unishop\extend\Hashids::decodeHex($order_id);
|
|
|
|
|
|
$orderModel = new \addons\unishop\model\Order();
|
|
@@ -358,7 +358,7 @@ class Order extends Base
|
|
|
*/
|
|
|
public function delete()
|
|
|
{
|
|
|
- $order_id = $this->request->get('order_id', 0);
|
|
|
+ $order_id = $this->request->request('order_id', 0);
|
|
|
$order_id = \addons\unishop\extend\Hashids::decodeHex($order_id);
|
|
|
|
|
|
$orderModel = new \addons\unishop\model\Order();
|
|
@@ -392,7 +392,7 @@ class Order extends Base
|
|
|
*/
|
|
|
public function received()
|
|
|
{
|
|
|
- $order_id = $this->request->get('order_id', 0);
|
|
|
+ $order_id = $this->request->request('order_id', 0);
|
|
|
$order_id = \addons\unishop\extend\Hashids::decodeHex($order_id);
|
|
|
|
|
|
$orderModel = new \addons\unishop\model\Order();
|
|
@@ -423,6 +423,7 @@ class Order extends Base
|
|
|
* @ApiParams (name="anonymous", type="integer", description="是否匿名")
|
|
|
* @ApiParams (name="comment", type="string", description="评价内容")
|
|
|
* @ApiParams (name="product_id", type="string", description="商品id")
|
|
|
+ * @ApiParams (name="images", type="string", description="图片集")
|
|
|
* @ApiReturn ({"code":1,"msg":"感谢评价","data":true})
|
|
|
*
|
|
|
*/
|
|
@@ -432,12 +433,11 @@ class Order extends Base
|
|
|
$anonymous = $this->request->post('anonymous', 0);
|
|
|
$comment = $this->request->post('comment');
|
|
|
$order_id = $this->request->post('order_id', 0);
|
|
|
+ $images = $this->request->post('images', '');
|
|
|
$order_id = \addons\unishop\extend\Hashids::decodeHex($order_id);
|
|
|
- $product_id = $this->request->post('product_id');
|
|
|
- $product_id = \addons\unishop\extend\Hashids::decodeHex($product_id);
|
|
|
|
|
|
$orderProductModel = new \addons\unishop\model\OrderProduct();
|
|
|
- $orderProduct = $orderProductModel->where(['product_id' => $product_id, 'order_id' => $order_id, 'user_id' => $this->auth->id])->find();
|
|
|
+ $orderProduct = $orderProductModel->where(['order_id' => $order_id, 'user_id' => $this->auth->id])->find();
|
|
|
|
|
|
$orderModel = new \addons\unishop\model\Order();
|
|
|
$order = $orderModel->where(['id' => $order_id, 'user_id' => $this->auth->id])->find();
|
|
@@ -455,10 +455,11 @@ class Order extends Base
|
|
|
$evaluate = new Evaluate();
|
|
|
$evaluate->user_id = $this->auth->id;
|
|
|
$evaluate->order_id = $order_id;
|
|
|
- $evaluate->product_id = $product_id;
|
|
|
+ $evaluate->product_id = $orderProduct->product_id;
|
|
|
$evaluate->rate = $rate;
|
|
|
$evaluate->anonymous = $anonymous;
|
|
|
$evaluate->comment = $comment;
|
|
|
+ $evaluate->images = $images;
|
|
|
$evaluate->spec = $orderProduct->spec;
|
|
|
$result = $evaluate->save();
|
|
|
|
|
@@ -591,7 +592,7 @@ class Order extends Base
|
|
|
*/
|
|
|
public function detail()
|
|
|
{
|
|
|
- $order_id = $this->request->get('order_id', 0);
|
|
|
+ $order_id = $this->request->request('order_id', 0);
|
|
|
$order_id = \addons\unishop\extend\Hashids::decodeHex($order_id);
|
|
|
|
|
|
try {
|