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

4

... ... @@ -124,8 +124,9 @@ class PayController extends HomeBaseController
$salesman = Db::name('my_user') -> where('id',$teacher['pid']) -> find();
foreach ($data_indent_goods as $key => $val){
$money_salesman += $val['price']*$val['number']*$money_ratio['salesman_ratio'];
$money_salesman_in = $val['price']*$val['number']*$money_ratio['salesman_ratio'];
$data_money_income_salesman['create_time'] = time();
$data_money_income_salesman['money'] = $money_salesman;
$data_money_income_salesman['money'] = $money_salesman_in;
$data_money_income_salesman['type'] = 1;
$data_money_income_salesman['book_name'] = $val['book_name'];
$data_money_income_salesman['book_thumbnail'] = $val['thumbnail'];
... ... @@ -133,15 +134,15 @@ class PayController extends HomeBaseController
$data_money_income_salesman['uid'] = $salesman['uid'];
$data_money_income_salesman['indent_id'] = $order['id'];
Db::name('money_income') -> insert($data_money_income_salesman);
$money_salesman = 0;
}
Db::name('my_user') -> where('uid',$salesman['uid']) -> setInc('balance',$money_salesman);
$money_teacher = 0;
foreach ($data_indent_goods as $key => $val){
$money_teacher += $val['price']*$val['number']*$money_ratio['teacher_ratio'];
$money_teacher_in = $val['price']*$val['number']*$money_ratio['teacher_ratio'];
$data_money_income_teacher['create_time'] = time();
$data_money_income_teacher['money'] = $money_teacher;
$data_money_income_teacher['money'] = $money_teacher_in;
$data_money_income_teacher['type'] = 1;
$data_money_income_teacher['book_name'] = $val['book_name'];
$data_money_income_teacher['book_thumbnail'] = $val['thumbnail'];
... ... @@ -149,7 +150,6 @@ class PayController extends HomeBaseController
$data_money_income_teacher['uid'] = $teacher['uid'];
$data_money_income_teacher['indent_id'] = $order['id'];
Db::name('money_income') -> insert($data_money_income_teacher);
$money_teacher = 0;
}
Db::name('my_user') -> where('uid',$teacher['uid']) -> setInc('balance',$money_teacher);
}
... ... @@ -166,8 +166,9 @@ class PayController extends HomeBaseController
$salesman = Db::name('my_user') -> where('id',$data_user['pid']) -> find();
foreach ($data_indent_goods as $key => $val){
$money_salesman += $val['price']*$val['number']*$money_ratio['salesman_ratio'];
$money_salesman_in = $val['price']*$val['number']*$money_ratio['salesman_ratio'];
$data_money_income_salesman['create_time'] = time();
$data_money_income_salesman['money'] = $money_salesman;
$data_money_income_salesman['money'] = $money_salesman_in;
$data_money_income_salesman['type'] = 1;
$data_money_income_salesman['book_name'] = $val['book_name'];
$data_money_income_salesman['book_thumbnail'] = $val['thumbnail'];
... ... @@ -175,14 +176,14 @@ class PayController extends HomeBaseController
$data_money_income_salesman['uid'] = $salesman['uid'];
$data_money_income_salesman['indent_id'] = $order['id'];
Db::name('money_income') -> insert($data_money_income_salesman);
$money_salesman = 0;
}
Db::name('my_user') -> where('uid',$salesman['uid']) -> setInc('balance',$money_salesman);
$money_teacher = 0;
foreach ($data_indent_goods as $key => $val){
$money_teacher += $val['price']*$val['number']*$money_ratio['teacher_ratio'];
$money_teacher_in = $val['price']*$val['number']*$money_ratio['teacher_ratio'];
$data_money_income_teacher['create_time'] = time();
$data_money_income_teacher['money'] = $money_teacher;
$data_money_income_teacher['money'] = $money_teacher_in;
$data_money_income_teacher['type'] = 1;
$data_money_income_teacher['book_name'] = $val['book_name'];
$data_money_income_teacher['book_thumbnail'] = $val['thumbnail'];
... ... @@ -190,7 +191,6 @@ class PayController extends HomeBaseController
$data_money_income_teacher['uid'] = $data_user['uid'];
$data_money_income_teacher['indent_id'] = $order['id'];
Db::name('money_income') -> insert($data_money_income_teacher);
$money_teacher = 0;
}
Db::name('my_user') -> where('uid',$data_user['uid']) -> setInc('balance',$money_teacher);
}
... ... @@ -210,8 +210,9 @@ class PayController extends HomeBaseController
$money = 0;
foreach ($data_indent_goods as $key => $val){
$money += $val['commission']*$val['number'];
$money_in = $val['commission']*$val['number'];
$money_income_teacher['create_time'] = time();
$money_income_teacher['money'] = $money;
$money_income_teacher['money'] = $money_in;
$money_income_teacher['type'] = 2;
$money_income_teacher['book_name'] = $val['book_name'];
$money_income_teacher['book_thumbnail'] = $val['thumbnail'];
... ... @@ -219,7 +220,6 @@ class PayController extends HomeBaseController
$money_income_teacher['uid'] = $teacher['uid'];
$money_income_teacher['indent_id'] = $order['id'];
Db::name('money_income') -> insert($money_income_teacher);
$money = 0;
}
//增加老师余额
Db::name('my_user') -> where('uid',$teacher['uid']) -> setInc('balance',$money);
... ... @@ -246,8 +246,9 @@ class PayController extends HomeBaseController
$money = 0;
foreach ($data_indent_goods as $key => $val){
$money += $val['commission']*$val['number'];
$money_in = $val['commission']*$val['number'];
$money_income_teacher['create_time'] = time();
$money_income_teacher['money'] = $money;
$money_income_teacher['money'] = $money_in;
$money_income_teacher['type'] = 2;
$money_income_teacher['book_name'] = $val['book_name'];
$money_income_teacher['book_thumbnail'] = $val['thumbnail'];
... ... @@ -255,7 +256,6 @@ class PayController extends HomeBaseController
$money_income_teacher['uid'] = $teacher;
$money_income_teacher['indent_id'] = $order['id'];
Db::name('money_income') -> insert($money_income_teacher);
$money = 0;
}
//增加老师余额
Db::name('my_user') -> where('uid',$teacher) -> setInc('balance',$money);
... ...