Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

insertOnDuplicateKey $updateColumns parameter doesn't allow strings #19

Open
nonsapiens opened this issue Nov 18, 2017 · 1 comment
Open

Comments

@nonsapiens
Copy link

The insertOnDuplicateKey function works great, except when trying to pass strings in the $updateColumns parameter, as the resulting SQL doesn't enclose the value in quotes to treat them as strings:

SponsoredCallWallet::insertOnDuplicateKey( [ 'msisdn' => $msisdn->toStrict(), 'client_id' => ServiceRequest::client()->id, 'sponsoredcall_campaign_id' => $campaign->id, 'balance' => $duration, 'created_at' => Carbon::now()->format( 'Y-m-d H:i:s' ), 'updated_at' => Carbon::now()->format( 'Y-m-d H:i:s' ), ], [ 'updated_at' => Carbon::now()->format( 'Y-m-d H:i:s' ), 'balance' => 'balance + ' . $duration, ] );

Is there something I'm doing wrong?

@yadakhov
Copy link
Owner

What error are you getting?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants