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

4

@@ -384,7 +384,16 @@ class SalesmanController extends AdminBaseController{ @@ -384,7 +384,16 @@ class SalesmanController extends AdminBaseController{
384 public function salesman_money(){ 384 public function salesman_money(){
385 385
386 $uid = $this -> request -> param(); 386 $uid = $this -> request -> param();
387 - $data = Db::name('money_income') -> where('uid',$uid['uid']) -> select(); 387 + $data = Db::name('money_income') -> alias('a') -> join("indent b","a.indent_id=b.id","LEFT") -> where('a.uid',$uid['uid']) -> select() -> toArray();
  388 + /* if(!empty($data)){
  389 + foreach ($data as $key=>$val){
  390 + if($val['type']==2){
  391 + $book_name = Db::name('indent_goods') -> where('indent_id',$val['indent_id']) -> select() -> toArray();
  392 + $data[$key]['book_name'] =
  393 + }
  394 + }
  395 + }
  396 + dump($data);die;*/
388 $this -> assign('data',$data); 397 $this -> assign('data',$data);
389 return $this -> fetch(); 398 return $this -> fetch();
390 399
@@ -629,8 +629,8 @@ class PersonalcenterController extends WeChatBaseController{ @@ -629,8 +629,8 @@ class PersonalcenterController extends WeChatBaseController{
629 } 629 }
630 if($res['grade'] != ''){ 630 if($res['grade'] != ''){
631 $school_grade_class = explode('-',$res['grade']); 631 $school_grade_class = explode('-',$res['grade']);
632 - $where['a.grade'] = $school_grade_class[0];  
633 - $where['a.class'] = $school_grade_class[1]; 632 + $where['a.grade'] = trim($school_grade_class[0]);
  633 + $where['a.class'] = trim($school_grade_class[1]);
634 } 634 }
635 635
636 if($res['start_time'] != '' && $res['end_time'] != ''){ 636 if($res['start_time'] != '' && $res['end_time'] != ''){
@@ -639,7 +639,8 @@ class PersonalcenterController extends WeChatBaseController{ @@ -639,7 +639,8 @@ class PersonalcenterController extends WeChatBaseController{
639 $where['a.pay_time'] = [['>=',$start_time],['<=',$end_time]]; 639 $where['a.pay_time'] = [['>=',$start_time],['<=',$end_time]];
640 } 640 }
641 /*$indent_goods = Db::name('indent') -> alias('a') -> field("a.*,b.indent_id,b.book_name,b.pricing,b.price,b.number,b.thumbnail") -> join('indent_goods b','a.id=b.indent_id','LEFT') -> where($where) -> where("a.state =2 or a.state=3 or a.state=5") -> select();*/ 641 /*$indent_goods = Db::name('indent') -> alias('a') -> field("a.*,b.indent_id,b.book_name,b.pricing,b.price,b.number,b.thumbnail") -> join('indent_goods b','a.id=b.indent_id','LEFT') -> where($where) -> where("a.state =2 or a.state=3 or a.state=5") -> select();*/
642 - $indent_money = Db::name('indent') -> alias('a') -> field("a.id,a.order_number,a.pay_time,b.uid,b.money,b.type,b.book_num,b.indent_id") -> join('money_income b','a.id=b.indent_id','LEFT') -> where($where) -> where("a.state =2 or a.state=3 or a.state=5") -> where("b.uid =".$uid) -> select() -> toArray(); 642 + $indent_money = Db::name('indent') -> alias('a') -> field("a.id,a.order_number,a.pay_time,b.uid,b.money,b.type,b.book_num,b.indent_id,a.school,a.grade,a.class") -> join('money_income b','a.id=b.indent_id','LEFT') -> where($where) -> where("a.state =2 or a.state=3 or a.state=5") -> where("b.uid =".$uid) -> select() -> toArray();
  643 +
643 if(count($indent_money)!=0){ 644 if(count($indent_money)!=0){
644 foreach ($indent_money as $key => $val){ 645 foreach ($indent_money as $key => $val){
645 $indent_money[$key]['book_name'] = Db::name('indent_goods') -> where('indent_id',$val['id']) -> select() -> toArray(); 646 $indent_money[$key]['book_name'] = Db::name('indent_goods') -> where('indent_id',$val['id']) -> select() -> toArray();
@@ -204,7 +204,7 @@ class WeChatBaseController extends BaseController @@ -204,7 +204,7 @@ class WeChatBaseController extends BaseController
204 */ 204 */
205 public function checkWeChatUserLogin() 205 public function checkWeChatUserLogin()
206 { 206 {
207 - /*$user = Db::name('user')->where('id',27)->find(); 207 + /*$user = Db::name('user')->where('id',6)->find();
208 cmf_update_current_user($user);*/ 208 cmf_update_current_user($user);*/
209 $userId = cmf_get_current_user_id(); 209 $userId = cmf_get_current_user_id();
210 if (empty($userId)) { 210 if (empty($userId)) {