model = new ShopCashOut(); } /** * 店铺提现详情 * @param int $id * @return array */ public function getInfo(int $id) { $field = 'id,site_id,cash_out_no,transfer_type,transfer_realname,transfer_mobile,transfer_bank,transfer_account,transfer_fail_reason,transfer_time,apply_money,rate,service_money,money,audit_time,status,remark,create_time,refuse_reason, transfer_no, transfer_payee, transfer_payment_code'; return $this->model->field($field)->where([ [ 'id', '=', $id ] ])->with(['siteInfo', 'transfer'])->append([ 'account_type_name', 'transfer_type_name', 'status_name', 'transfer_status_name' ])->findOrEmpty()->toArray(); } /** * 提现转账(微信零钱) * @param int $id * @return void */ public function transfer(int $id, array $data){ $data['channel'] = $this->channel; $result = (new CoreShopCashOutService())->transfer($id, $data); return $result; } /** * 转账检测 * @param string $code * @return bool|int */ public function checkTransfer(string $code) { if (empty($code)) throw new ApiException('TRANSFER_CODE_EXPIRED');//转账二维码已过期 $id = Cache::get($code); if (empty($id)) throw new ApiException('TRANSFER_CODE_EXPIRED');//转账二维码已过期 return $id; } }