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

4

... ... @@ -384,7 +384,16 @@ class SalesmanController extends AdminBaseController{
public function salesman_money(){
$uid = $this -> request -> param();
$data = Db::name('money_income') -> where('uid',$uid['uid']) -> select();
$data = Db::name('money_income') -> alias('a') -> join("indent b","a.indent_id=b.id","LEFT") -> where('a.uid',$uid['uid']) -> select() -> toArray();
/* if(!empty($data)){
foreach ($data as $key=>$val){
if($val['type']==2){
$book_name = Db::name('indent_goods') -> where('indent_id',$val['indent_id']) -> select() -> toArray();
$data[$key]['book_name'] =
}
}
}
dump($data);die;*/
$this -> assign('data',$data);
return $this -> fetch();
... ...
... ... @@ -629,8 +629,8 @@ class PersonalcenterController extends WeChatBaseController{
}
if($res['grade'] != ''){
$school_grade_class = explode('-',$res['grade']);
$where['a.grade'] = $school_grade_class[0];
$where['a.class'] = $school_grade_class[1];
$where['a.grade'] = trim($school_grade_class[0]);
$where['a.class'] = trim($school_grade_class[1]);
}
if($res['start_time'] != '' && $res['end_time'] != ''){
... ... @@ -639,7 +639,8 @@ class PersonalcenterController extends WeChatBaseController{
$where['a.pay_time'] = [['>=',$start_time],['<=',$end_time]];
}
/*$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();*/
$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();
$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();
if(count($indent_money)!=0){
foreach ($indent_money as $key => $val){
$indent_money[$key]['book_name'] = Db::name('indent_goods') -> where('indent_id',$val['id']) -> select() -> toArray();
... ...
... ... @@ -204,7 +204,7 @@ class WeChatBaseController extends BaseController
*/
public function checkWeChatUserLogin()
{
/*$user = Db::name('user')->where('id',27)->find();
/*$user = Db::name('user')->where('id',6)->find();
cmf_update_current_user($user);*/
$userId = cmf_get_current_user_id();
if (empty($userId)) {
... ...