...
|
...
|
@@ -336,8 +336,9 @@ class ShareController extends RestBaseController |
|
|
$money = round($info['money']/$info['num'],1);
|
|
|
Db::startTrans();
|
|
|
if ($info['id'] == $data['user_id']) {
|
|
|
$res1 = true;
|
|
|
$res1 = true;
|
|
|
$res2 = true;
|
|
|
$res3 = true;
|
|
|
} else {
|
|
|
//业务员 减
|
|
|
$array = [
|
...
|
...
|
@@ -371,15 +372,14 @@ class ShareController extends RestBaseController |
|
|
];
|
|
|
Db::name('money_log')->insert($update_arr);
|
|
|
}
|
|
|
|
|
|
//分享记录
|
|
|
$arr2 = [
|
|
|
'card_id'=>$data['card_id'],
|
|
|
'user_id'=>$this->userId,
|
|
|
'share_id'=>$data['user_id']
|
|
|
];
|
|
|
$res3 = Db::name('card_log')->insert($arr2);
|
|
|
}
|
|
|
//分享记录
|
|
|
$arr2 = [
|
|
|
'card_id'=>$data['card_id'],
|
|
|
'user_id'=>$this->userId,
|
|
|
'share_id'=>$data['user_id']
|
|
|
];
|
|
|
$res3 = Db::name('card_log')->insert($arr2);
|
|
|
if ($res1 === false || $res2 === false || $res3 === false) {
|
|
|
Db::rollback();
|
|
|
$this->error(['code'=>'40000','msg'=>'操作失败']);
|
...
|
...
|
|