Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ionic-framework/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Mysql Laravel 3-雄辩的save()一次又一次地保存错误的值_Mysql_Payment Gateway_Eloquent_Laravel 3 - Fatal编程技术网

Mysql Laravel 3-雄辩的save()一次又一次地保存错误的值

Mysql Laravel 3-雄辩的save()一次又一次地保存错误的值,mysql,payment-gateway,eloquent,laravel-3,Mysql,Payment Gateway,Eloquent,Laravel 3,我会尽力解释我的处境。对不起,如果没有意义的话,一开始就真的没有意义 我有一个应用程序,利用了Laravel 3。我有一个型号名称收据,其中包含来自具有支付网关的交易的支付历史记录。每次某人支付某件东西时,都会向数据库中添加一个收据条目 接收模式: public function up() { Schema::table('receipts', function($table) { $table->create(); $table->incre

我会尽力解释我的处境。对不起,如果没有意义的话,一开始就真的没有意义

我有一个应用程序,利用了Laravel 3。我有一个型号名称收据,其中包含来自具有支付网关的交易的支付历史记录。每次某人支付某件东西时,都会向数据库中添加一个收据条目

接收模式

public function up() {
    Schema::table('receipts', function($table) {
        $table->create();
        $table->increments('id');
        $table->integer('individual_id')->unsigned();
        $table->integer('transaction_id')->unsigned();
        $table->decimal('amount', 6, 2);
        $table->string('account_number', 8)->nullable();
        $table->string('category', 255)->nullable();
        $table->timestamps();
    });
}
...
收据控制器代码段

...
if ($response->approved) {                
    $r = new Receipt();
    $r->individual_id = $response->customer_id;
    $r->transaction_id = $response->transaction_id;
    $r->amount = $response->amount;
    $r->account_number = $response->account_number;
    $r->category = $response->description;
    $r->save();

    $url = URL::to_action('receipt@history', array($response->transaction_id));
} else {
...
我的问题是事务id没有保存正确的值。我已经验证了在返回的$response->transaction_id属性中找到了支付网关响应,但是保存到DB字段的内容不正确。例如,假设支付网关$response->transaction_id为5879971244。。。对于每个事务ID,保存到DB的是4294967295。这就像我有一个setter方法用于此字段,但我没有


如果我将任意值硬编码到$r->transaction\u id,例如1234567890,然后是$r->save(),它会很好地保存,只是不会保存$response对象中的值。

看起来Int字段最多只允许4294967295,这是我数据库中存储的值。我将字段更改为bar varchar。问题解决了