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

4

@@ -124,8 +124,9 @@ class PayController extends HomeBaseController @@ -124,8 +124,9 @@ class PayController extends HomeBaseController
124 $salesman = Db::name('my_user') -> where('id',$teacher['pid']) -> find(); 124 $salesman = Db::name('my_user') -> where('id',$teacher['pid']) -> find();
125 foreach ($data_indent_goods as $key => $val){ 125 foreach ($data_indent_goods as $key => $val){
126 $money_salesman += $val['price']*$val['number']*$money_ratio['salesman_ratio']; 126 $money_salesman += $val['price']*$val['number']*$money_ratio['salesman_ratio'];
  127 + $money_salesman_in = $val['price']*$val['number']*$money_ratio['salesman_ratio'];
127 $data_money_income_salesman['create_time'] = time(); 128 $data_money_income_salesman['create_time'] = time();
128 - $data_money_income_salesman['money'] = $money_salesman; 129 + $data_money_income_salesman['money'] = $money_salesman_in;
129 $data_money_income_salesman['type'] = 1; 130 $data_money_income_salesman['type'] = 1;
130 $data_money_income_salesman['book_name'] = $val['book_name']; 131 $data_money_income_salesman['book_name'] = $val['book_name'];
131 $data_money_income_salesman['book_thumbnail'] = $val['thumbnail']; 132 $data_money_income_salesman['book_thumbnail'] = $val['thumbnail'];
@@ -133,15 +134,15 @@ class PayController extends HomeBaseController @@ -133,15 +134,15 @@ class PayController extends HomeBaseController
133 $data_money_income_salesman['uid'] = $salesman['uid']; 134 $data_money_income_salesman['uid'] = $salesman['uid'];
134 $data_money_income_salesman['indent_id'] = $order['id']; 135 $data_money_income_salesman['indent_id'] = $order['id'];
135 Db::name('money_income') -> insert($data_money_income_salesman); 136 Db::name('money_income') -> insert($data_money_income_salesman);
136 - $money_salesman = 0;  
137 } 137 }
138 Db::name('my_user') -> where('uid',$salesman['uid']) -> setInc('balance',$money_salesman); 138 Db::name('my_user') -> where('uid',$salesman['uid']) -> setInc('balance',$money_salesman);
139 139
140 $money_teacher = 0; 140 $money_teacher = 0;
141 foreach ($data_indent_goods as $key => $val){ 141 foreach ($data_indent_goods as $key => $val){
142 $money_teacher += $val['price']*$val['number']*$money_ratio['teacher_ratio']; 142 $money_teacher += $val['price']*$val['number']*$money_ratio['teacher_ratio'];
  143 + $money_teacher_in = $val['price']*$val['number']*$money_ratio['teacher_ratio'];
143 $data_money_income_teacher['create_time'] = time(); 144 $data_money_income_teacher['create_time'] = time();
144 - $data_money_income_teacher['money'] = $money_teacher; 145 + $data_money_income_teacher['money'] = $money_teacher_in;
145 $data_money_income_teacher['type'] = 1; 146 $data_money_income_teacher['type'] = 1;
146 $data_money_income_teacher['book_name'] = $val['book_name']; 147 $data_money_income_teacher['book_name'] = $val['book_name'];
147 $data_money_income_teacher['book_thumbnail'] = $val['thumbnail']; 148 $data_money_income_teacher['book_thumbnail'] = $val['thumbnail'];
@@ -149,7 +150,6 @@ class PayController extends HomeBaseController @@ -149,7 +150,6 @@ class PayController extends HomeBaseController
149 $data_money_income_teacher['uid'] = $teacher['uid']; 150 $data_money_income_teacher['uid'] = $teacher['uid'];
150 $data_money_income_teacher['indent_id'] = $order['id']; 151 $data_money_income_teacher['indent_id'] = $order['id'];
151 Db::name('money_income') -> insert($data_money_income_teacher); 152 Db::name('money_income') -> insert($data_money_income_teacher);
152 - $money_teacher = 0;  
153 } 153 }
154 Db::name('my_user') -> where('uid',$teacher['uid']) -> setInc('balance',$money_teacher); 154 Db::name('my_user') -> where('uid',$teacher['uid']) -> setInc('balance',$money_teacher);
155 } 155 }
@@ -166,8 +166,9 @@ class PayController extends HomeBaseController @@ -166,8 +166,9 @@ class PayController extends HomeBaseController
166 $salesman = Db::name('my_user') -> where('id',$data_user['pid']) -> find(); 166 $salesman = Db::name('my_user') -> where('id',$data_user['pid']) -> find();
167 foreach ($data_indent_goods as $key => $val){ 167 foreach ($data_indent_goods as $key => $val){
168 $money_salesman += $val['price']*$val['number']*$money_ratio['salesman_ratio']; 168 $money_salesman += $val['price']*$val['number']*$money_ratio['salesman_ratio'];
  169 + $money_salesman_in = $val['price']*$val['number']*$money_ratio['salesman_ratio'];
169 $data_money_income_salesman['create_time'] = time(); 170 $data_money_income_salesman['create_time'] = time();
170 - $data_money_income_salesman['money'] = $money_salesman; 171 + $data_money_income_salesman['money'] = $money_salesman_in;
171 $data_money_income_salesman['type'] = 1; 172 $data_money_income_salesman['type'] = 1;
172 $data_money_income_salesman['book_name'] = $val['book_name']; 173 $data_money_income_salesman['book_name'] = $val['book_name'];
173 $data_money_income_salesman['book_thumbnail'] = $val['thumbnail']; 174 $data_money_income_salesman['book_thumbnail'] = $val['thumbnail'];
@@ -175,14 +176,14 @@ class PayController extends HomeBaseController @@ -175,14 +176,14 @@ class PayController extends HomeBaseController
175 $data_money_income_salesman['uid'] = $salesman['uid']; 176 $data_money_income_salesman['uid'] = $salesman['uid'];
176 $data_money_income_salesman['indent_id'] = $order['id']; 177 $data_money_income_salesman['indent_id'] = $order['id'];
177 Db::name('money_income') -> insert($data_money_income_salesman); 178 Db::name('money_income') -> insert($data_money_income_salesman);
178 - $money_salesman = 0;  
179 } 179 }
180 Db::name('my_user') -> where('uid',$salesman['uid']) -> setInc('balance',$money_salesman); 180 Db::name('my_user') -> where('uid',$salesman['uid']) -> setInc('balance',$money_salesman);
181 $money_teacher = 0; 181 $money_teacher = 0;
182 foreach ($data_indent_goods as $key => $val){ 182 foreach ($data_indent_goods as $key => $val){
183 $money_teacher += $val['price']*$val['number']*$money_ratio['teacher_ratio']; 183 $money_teacher += $val['price']*$val['number']*$money_ratio['teacher_ratio'];
  184 + $money_teacher_in = $val['price']*$val['number']*$money_ratio['teacher_ratio'];
184 $data_money_income_teacher['create_time'] = time(); 185 $data_money_income_teacher['create_time'] = time();
185 - $data_money_income_teacher['money'] = $money_teacher; 186 + $data_money_income_teacher['money'] = $money_teacher_in;
186 $data_money_income_teacher['type'] = 1; 187 $data_money_income_teacher['type'] = 1;
187 $data_money_income_teacher['book_name'] = $val['book_name']; 188 $data_money_income_teacher['book_name'] = $val['book_name'];
188 $data_money_income_teacher['book_thumbnail'] = $val['thumbnail']; 189 $data_money_income_teacher['book_thumbnail'] = $val['thumbnail'];
@@ -190,7 +191,6 @@ class PayController extends HomeBaseController @@ -190,7 +191,6 @@ class PayController extends HomeBaseController
190 $data_money_income_teacher['uid'] = $data_user['uid']; 191 $data_money_income_teacher['uid'] = $data_user['uid'];
191 $data_money_income_teacher['indent_id'] = $order['id']; 192 $data_money_income_teacher['indent_id'] = $order['id'];
192 Db::name('money_income') -> insert($data_money_income_teacher); 193 Db::name('money_income') -> insert($data_money_income_teacher);
193 - $money_teacher = 0;  
194 } 194 }
195 Db::name('my_user') -> where('uid',$data_user['uid']) -> setInc('balance',$money_teacher); 195 Db::name('my_user') -> where('uid',$data_user['uid']) -> setInc('balance',$money_teacher);
196 } 196 }
@@ -210,8 +210,9 @@ class PayController extends HomeBaseController @@ -210,8 +210,9 @@ class PayController extends HomeBaseController
210 $money = 0; 210 $money = 0;
211 foreach ($data_indent_goods as $key => $val){ 211 foreach ($data_indent_goods as $key => $val){
212 $money += $val['commission']*$val['number']; 212 $money += $val['commission']*$val['number'];
  213 + $money_in = $val['commission']*$val['number'];
213 $money_income_teacher['create_time'] = time(); 214 $money_income_teacher['create_time'] = time();
214 - $money_income_teacher['money'] = $money; 215 + $money_income_teacher['money'] = $money_in;
215 $money_income_teacher['type'] = 2; 216 $money_income_teacher['type'] = 2;
216 $money_income_teacher['book_name'] = $val['book_name']; 217 $money_income_teacher['book_name'] = $val['book_name'];
217 $money_income_teacher['book_thumbnail'] = $val['thumbnail']; 218 $money_income_teacher['book_thumbnail'] = $val['thumbnail'];
@@ -219,7 +220,6 @@ class PayController extends HomeBaseController @@ -219,7 +220,6 @@ class PayController extends HomeBaseController
219 $money_income_teacher['uid'] = $teacher['uid']; 220 $money_income_teacher['uid'] = $teacher['uid'];
220 $money_income_teacher['indent_id'] = $order['id']; 221 $money_income_teacher['indent_id'] = $order['id'];
221 Db::name('money_income') -> insert($money_income_teacher); 222 Db::name('money_income') -> insert($money_income_teacher);
222 - $money = 0;  
223 } 223 }
224 //增加老师余额 224 //增加老师余额
225 Db::name('my_user') -> where('uid',$teacher['uid']) -> setInc('balance',$money); 225 Db::name('my_user') -> where('uid',$teacher['uid']) -> setInc('balance',$money);
@@ -246,8 +246,9 @@ class PayController extends HomeBaseController @@ -246,8 +246,9 @@ class PayController extends HomeBaseController
246 $money = 0; 246 $money = 0;
247 foreach ($data_indent_goods as $key => $val){ 247 foreach ($data_indent_goods as $key => $val){
248 $money += $val['commission']*$val['number']; 248 $money += $val['commission']*$val['number'];
  249 + $money_in = $val['commission']*$val['number'];
249 $money_income_teacher['create_time'] = time(); 250 $money_income_teacher['create_time'] = time();
250 - $money_income_teacher['money'] = $money; 251 + $money_income_teacher['money'] = $money_in;
251 $money_income_teacher['type'] = 2; 252 $money_income_teacher['type'] = 2;
252 $money_income_teacher['book_name'] = $val['book_name']; 253 $money_income_teacher['book_name'] = $val['book_name'];
253 $money_income_teacher['book_thumbnail'] = $val['thumbnail']; 254 $money_income_teacher['book_thumbnail'] = $val['thumbnail'];
@@ -255,7 +256,6 @@ class PayController extends HomeBaseController @@ -255,7 +256,6 @@ class PayController extends HomeBaseController
255 $money_income_teacher['uid'] = $teacher; 256 $money_income_teacher['uid'] = $teacher;
256 $money_income_teacher['indent_id'] = $order['id']; 257 $money_income_teacher['indent_id'] = $order['id'];
257 Db::name('money_income') -> insert($money_income_teacher); 258 Db::name('money_income') -> insert($money_income_teacher);
258 - $money = 0;  
259 } 259 }
260 //增加老师余额 260 //增加老师余额
261 Db::name('my_user') -> where('uid',$teacher) -> setInc('balance',$money); 261 Db::name('my_user') -> where('uid',$teacher) -> setInc('balance',$money);