/** * 获取对应支付信息,视频专用 */ public function getPays() { $payModel = PayModel::where('genre', 1)->where('order_id', $this->id)->orderBy('id', 'asc')->get(); return $payModel ? $payModel : []; }
/** * 获取对应支付信息 */ public function getPay() { $payModel = PayModel::where('genre', 3)->where('order_id', $this->id)->first(); return $payModel ? $payModel : ''; }
/** * 卖方确定已到款,下一步办理 */ public function setPayStatus($id, $cate, $status) { $orderModel = OrderModel::find($id); if (!in_array($orderModel->genre, [5, 6])) { PayModel::where('order_id', $id)->update(['ispay' => $status, 'updated_at' => time()]); } else { $payModels = PayModel::where('order_id', $id)->get(); PayModel::where('id', $payModels[$cate - 1])->update(['ispay' => $status, 'updated_at' => time()]); } return redirect(DOMAIN . 'member/order/' . $id); }