isEmpty()){ // page_result(1, "用户信息不存在"); // } // $workerall = WorkerModel::where('userid','=',$user->id)->select(); // $agentall = AgentModel::where('userid','=',$user->id)->select(); // $brokerall = BrokerModel::where('userid','=',$user->id)->select(); // page_result(0, "", array( // 'user' => $user, // 'workerall' => $workerall->isEmpty() ? null : $workerall, // 'agentall' => $agentall->isEmpty() ? null : $agentall, // 'brokerall' => $brokerall->isEmpty() ? null : $brokerall // )); // } public function regWorker() { $userid = input('userid/d', 0); $wtype = input('wtype/d', 1); $title = input('title/s', ""); $realname = input('realname/s', ""); $mobile = input('mobile/s', ""); $province = input('province/s', ""); $picone = input('picone/s', ""); if (empty($realname) || empty($mobile) || empty($province)) { page_result(1, "姓名,手机号,所属地区不能为空。"); } if ($wtype == 2) { if (empty($title)) { page_result(1, "公司名称不能为空。"); } if (empty($picone)) { page_result(1, "相关证件不能为空。"); } } $data = [ 'userid' => $userid, 'wtype' => $wtype, 'title' => input('title/s', ""), 'ftitle' => input('ftitle/s', ""), 'realname' => input('realname/s', ""), 'mobile' => input('mobile/s', ""), 'weixin' => input('weixin/s', ""), 'latitude' => 0.000000, 'longitude' => 0.000000, 'province' => input('province/s', ""), 'city' => input('city/s', ""), 'district' => input('district/s', ""), 'address' => input('address/s', ""), 'picone' => input('picone/s', ""), 'pictwo' => input('pictwo/s', ""), 'picthr' => input('picthr/s', ""), 'details' => input('details/s', ""), 'priority' => 0, 'remark' => "", 'status' => 1, 'createtime' => time(), ]; $worker = WorkerModel::create($data); page_result(0, "", [ 'worker' => $worker, ]); } }