项目做到一半,被老板外包出去了,我看了一下外包程序员的写的代码,我认为把他枪毙五分钟不为过吧

class ApiserviceController extends Controller
{
    private $memberRepository;
    public function __construct(MemberRepository $memberRepository){
        $this->memberRepository = $memberRepository;
    }
    public function party_member_list(Request $request){
        $member_keyword = $request->input('member_keyword');

        $party_members=PartyMember::where('name','like','%'.$member_keyword.'%')->get();
        return response()->json($party_members);
    }

    public function party_fee_search(Request $request){
        $licence_id = $request->input('keyword');
        $party_fee_log= PartyFee::where('party_member_licence_id',$licence_id)->get();
        $sql="SELECT sum(party_member_fee) as feeamount FROM party_fees WHERE party_member_licence_id = ".$licence_id;
        $party_fee_amount = DB::select($sql);
        $party_fee['feelog']=$party_fee_log;

        $i=0;
        foreach($party_fee_log as $log){
            $party_fee_log[$i]['payment_stats_cn']=payment_stats_cn($log['payment_stats']);
            $i++;
        }
        $party_fee['feeamount']=$party_fee_amount;
        return response()->json($party_fee);
    }

    public function meeting_signing(Request $request){
        $sign_type = $request->input('type');
        $meeting_id = $request->input('meeting');

        $member_current = Auth::user()->member()->first();

        $member_id = $member_current->id;
        //dd($member_id);
        if($sign_type == 'sign_in'){
            $data_set = 'member_sign_in';
            $operation_cn = '签到';
            $type = 'signin';
        }
        else{
            $data_set = 'member_sign_out';
            $operation_cn='签退';
            $type = 'signout';
        }

        $meeting_info = Meeting::find($meeting_id);
        MeetingMembers::where(['meeting_id'=>$meeting_id,'member_id'=>$member_id])->update([$data_set=>1]);

        $account = new MemberAccount();
        $log_content = $meeting_info['meeting_title'].$operation_cn."获得积分";
        $account->credit($member_id,1,$type,$meeting_id,$log_content);
        //$meeting_member = MeetingMembers::where(['meeting_id'=>$meeting_id,'member_id'=>$member_id])->get();

        $view_vars=['meeting'=>$meeting_info,'operation_type'=>$operation_cn,'meeting_member'=>$member_current];

        return view('api.meeting.sign',$view_vars);
    }

    public function org_members(Request $request){

        //$MemberRepository = new MemberRepository();
        //$members = $this->memberRepository->getList($request-
        if($request->input('org_id')==''){
            $sql="SELECT * FROM department_member as dm LEFT JOIN departments AS d ON d.id = dm.department_id LEFT JOIN members as m ON m.id = dm.member_id WHERE dm.department_id > 0 AND (dm.department_id = 21 OR d.parent_id = 21) GROUP BY dm.member_id ";
            $members['data'] = DB::select($sql);
        }
        else{
            $sql="SELECT * FROM department_member as dm LEFT JOIN departments AS d ON d.id = dm.department_id LEFT JOIN members as m ON m.id = dm.member_id WHERE dm.department_id = :orgid";
            $members['data'] = DB::select($sql,['orgid'=>$request->input('org_id')]);
        }

        return response()->json($members);
    }

    public function learning_credit_add(Request $request){
        $member_current = Auth::user()->member()->first();
        $member_id = $member_current->id;
        $art_id = $request->input('art_id');
        $minutes = $request->input('seconds');

        $where = ['binding_id'=>$art_id,'log_type'=>'learning','member_id'=>$member_id];

        $account_exist = MemberAccountLog::where($where)->get();
        print_r($account_exist);
        if(count($account_exist)==0){
            $log_arr = [
                'member_id'=>$member_id,
                'log_content'=> $minutes,
                'log_type'=>'learning',
                'binding_id'=>$art_id
            ];
            $account_log = new MemberAccountLog($log_arr);
            $account_log->save();
        }
        else{
            $log_arr = [
                'log_content'=> $minutes,
                'log_credit'=>$minutes
            ];
            MemberAccountLog::where($where)->update($log_arr);
        }

    }
}

这写的叫啥XX玩意啊