处理订单查询和退货

This commit is contained in:
liu 2024-06-07 09:31:43 +08:00
parent fa07cff6ed
commit 48376313a9
2 changed files with 18 additions and 3 deletions

View File

@ -9,7 +9,6 @@ use app\api\validate\OrderValidate;
use app\common\enum\PayEnum;
use app\common\logic\PaymentLogic;
use app\common\logic\PayNotifyLogic;
use app\common\model\retail\Cashierclass;
use app\common\model\store_order\StoreOrder;
use app\common\model\system_store\SystemStoreStaff;
use app\common\model\user\UserAddress;
@ -475,6 +474,20 @@ class OrderController extends BaseApiController
$res = StoreOrder::where($where)->whereDay('create_time', $date)->count();
return $this->success('ok', ['order_count' => $res]);
}
//订单退款申请
public function apply_refund()
{
$params = (new OrderValidate())->post()->goCheck('add');
$uid = $this->userId;
// OrderLogic::dealRefund($uid,$params);
}
}

View File

@ -44,12 +44,14 @@ class OrderList extends BaseAdminDataLists implements ListsSearchInterface
{
$userId=$this->request->userId;
if(!$userId) return [];
return StoreOrder::with(['store'])->where($this->searchWhere)->where('uid',$userId)
return StoreOrder::with(['store'])->where($this->searchWhere)->where('uid',$userId)
->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc'])
->select()
->each(function($item){
$item['goods_list']=StoreOrderCartInfo::where('oid',$item['id'])->with('goodsName')->field('product_id,cart_num,verify_code,is_writeoff,writeoff_time')->limit(3)->select();
$item['goods_list']=StoreOrderCartInfo::where('oid',$item['id'])->with(['goodsName'=> function ($query) {
$query->withTrashed();
}])->field('product_id,cart_num,verify_code,is_writeoff,writeoff_time')->limit(3)->select();
$item['goods_count']=count(explode(',',$item['cart_id']));
})
->toArray();