作者 lihan
1 个管道 的构建 通过 耗费 1 秒

赠送积分和角色管理

@@ -127,13 +127,22 @@ class FriendController extends HomeBaseController @@ -127,13 +127,22 @@ class FriendController extends HomeBaseController
127 if ($total > 0) { 127 if ($total > 0) {
128 if (Db::name('user')->where(['id' => $uid])->setDec('balance', $total)) { 128 if (Db::name('user')->where(['id' => $uid])->setDec('balance', $total)) {
129 if (Db::name('user')->where(['id' => $friend_id])->setInc('balance', $total)) { 129 if (Db::name('user')->where(['id' => $friend_id])->setInc('balance', $total)) {
130 - //插入赠送记录日志log 130 + //被赠送者插入赠送记录日志log
131 $log = [ 131 $log = [
132 - 'uid' => $friend_id,  
133 - 'create_time' => time(),  
134 - 'balance' => $total,  
135 - 'type' => 3 132 + 0 => [
  133 + 'uid' => $friend_id,
  134 + 'create_time' => time(),
  135 + 'balance' => $total,
  136 + 'type' => 3
  137 + ],
  138 + 1 => [
  139 + 'uid' => session('user.id'),
  140 + 'create_time' => time(),
  141 + 'balance' => $total,
  142 + 'type' => 3
  143 + ]
136 ]; 144 ];
  145 +
137 if (Db::name('zj_integral_log')->insert($log)) { 146 if (Db::name('zj_integral_log')->insert($log)) {
138 Db::commit(); 147 Db::commit();
139 $tag = true; 148 $tag = true;