使用的框架為 laravle 5.5,目前有一個(gè)需求,需要按區(qū)域計(jì)算用戶分紅,然后修改用戶的分紅余額,修改已分紅金額等,數(shù)據(jù)庫(kù)結(jié)構(gòu)為:
//分紅記錄表
Schema::create('bonus_queue', function (Blueprint $table) {
$table->increments('id');
$table->integer('region')->comment('區(qū)域');
$table->integer('member_id')->comment('會(huì)員id');
$table->decimal('bonus', 12, 2)->comment('應(yīng)得分紅');
$table->decimal('have_bonus', 12, 2)->comment('已得分紅');
$table->tinyInteger('status')->comment('1正在分紅2分紅完成');
$table->timestamps();
});
//用戶表
Schema::create('members', function (Blueprint $table) {
$table->increments('id');
$table->decimal('bonus', 12, 2)->comment('分紅金額');
$table->timestamps();
});
謝謝各位大佬提供思路!
php如何快速進(jìn)行10萬(wàn)+的數(shù)據(jù)計(jì)算并且修改數(shù)據(jù)庫(kù)數(shù)據(jù)?
繁華開(kāi)滿天機(jī)
2019-03-07 14:50:11