...
|
...
|
@@ -25,6 +25,7 @@ class MemberController extends CommentController |
|
|
{
|
|
|
$where_member['id'] = Session::get('uid');
|
|
|
$member = Db::name('Member')->where($where_member)->find();
|
|
|
$member['wx_pic'] = cmf_get_image_url($member['wx_pic']);
|
|
|
$this->assign('list',$member);
|
|
|
return $this->fetch();
|
|
|
}
|
...
|
...
|
@@ -32,63 +33,55 @@ class MemberController extends CommentController |
|
|
public function changeUser(){
|
|
|
$where_member['id'] = Session::get('uid');
|
|
|
$member = Db::name('Member')->where($where_member)->find();
|
|
|
$member['wx_pic'] = cmf_get_image_url($member['wx_pic']);
|
|
|
$this->assign('list',$member);
|
|
|
return $this->fetch('editmaterial');
|
|
|
}
|
|
|
// 修改资料
|
|
|
public function change(){
|
|
|
$data = $this->request->param();
|
|
|
echo "<pre/>";
|
|
|
print_r($_FILES);
|
|
|
die;
|
|
|
if ((($_FILES["file"]["type"] == "image/gif")
|
|
|
|| ($_FILES["file"]["type"] == "image/jpeg")
|
|
|
|| ($_FILES["file"]["type"] == "image/pjpeg"))
|
|
|
&& ($_FILES["file"]["size"] < 20000))
|
|
|
{
|
|
|
if ($_FILES["file"]["error"] > 0)
|
|
|
{
|
|
|
echo "Return Code: " . $_FILES["file"]["error"] . "<br />";
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
echo "Upload: " . $_FILES["file"]["name"] . "<br />";
|
|
|
echo "Type: " . $_FILES["file"]["type"] . "<br />";
|
|
|
echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />";
|
|
|
echo "Temp file: " . $_FILES["file"]["tmp_name"] . "<br />";
|
|
|
|
|
|
if (file_exists("upload/" . $_FILES["file"]["name"]))
|
|
|
{
|
|
|
echo $_FILES["file"]["name"] . " already exists. ";
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
move_uploaded_file($_FILES["file"]["tmp_name"],
|
|
|
"upload/" . $_FILES["file"]["name"]);
|
|
|
echo "Stored in: " . "upload/" . $_FILES["file"]["name"];
|
|
|
}
|
|
|
}
|
|
|
$final = array();
|
|
|
if(!empty($_FILES)){
|
|
|
// 图片
|
|
|
$res = $this->pic($_FILES);
|
|
|
$final[] = cmf_get_image_url($res);
|
|
|
$data['wx_pic'] = $res;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
echo "Invalid file";
|
|
|
}
|
|
|
|
|
|
die;
|
|
|
|
|
|
// $validate = Loader::validate('Member');
|
|
|
// if(!$validate->sceneIsset()->check($data)){
|
|
|
// $mes = $validate->getError();
|
|
|
// $this->apiResponse('0',$mes);
|
|
|
// }
|
|
|
$where_member['id'] = Session::get('uid');
|
|
|
$data['update_time'] = time();
|
|
|
$res = Db::name('Member')->where($where_member)->update($data);
|
|
|
if($res){
|
|
|
$this->apiResponse('1',"成功");
|
|
|
$this->apiResponse('1',"成功",$final);
|
|
|
}else{
|
|
|
$this->apiResponse('0',"失败");
|
|
|
}
|
|
|
|
|
|
}
|
|
|
// 图片
|
|
|
public function pic($file){
|
|
|
if ((($file["file"]["type"] == "image/gif")
|
|
|
|| ($file["file"]["type"] == "image/jpeg")
|
|
|
|| ($file["file"]["type"] == "image/png"))
|
|
|
&& ($file["file"]["size"] < 100000))
|
|
|
{
|
|
|
if ($file["file"]["error"] > 0)
|
|
|
{
|
|
|
$this->apiResponse('0',$file["file"]["error"]);
|
|
|
}else{
|
|
|
$data = './upload/';
|
|
|
$flodername = 'pic/' . date("Ymd", time());
|
|
|
$png = uniqid() . '.png';
|
|
|
$filename = $data.$flodername . '/' . $png;
|
|
|
if (!file_exists($data.$flodername)){
|
|
|
mkdir($data.$flodername, 0777, true);
|
|
|
}
|
|
|
move_uploaded_file($_FILES["file"]["tmp_name"],
|
|
|
$filename);
|
|
|
return $flodername . '/' . $png;
|
|
|
}
|
|
|
}else{
|
|
|
$this->apiResponse('0','图片格式错误');
|
|
|
}
|
|
|
}
|
|
|
|
|
|
// 我的订单
|
...
|
...
|
@@ -112,24 +105,188 @@ die; |
|
|
->field('o.id,o.order_sn,o.status as orderStatus,o.create_time as cre,o.update_time as up , h.id as hire_id,h.* , s.name as select_name ,m.name as member_name ')
|
|
|
->order('o.create_time desc')
|
|
|
->select()->toArray();
|
|
|
if($coo_list){
|
|
|
foreach ($coo_list as $k=>$v){
|
|
|
$coo_list[$k]['start_time'] = date('Y.m.d',strtotime($v['start_time']));
|
|
|
$coo_list[$k]['end_time'] = date('Y.m.d',strtotime($v['end_time']));
|
|
|
}
|
|
|
}
|
|
|
$this->apiResponse('1','成功',$coo_list);
|
|
|
}
|
|
|
|
|
|
// 我的订单详情
|
|
|
public function detail(){
|
|
|
$data = $this->request->param();
|
|
|
if(!empty($data['type'])){
|
|
|
$where_order['o.status'] = $data['type'];
|
|
|
}else{
|
|
|
$where_order['o.status'] = array('neq',9);
|
|
|
}
|
|
|
$where_order['o.id'] = $data['id'];
|
|
|
$where_order['h.user_id'] = Session::get('uid');
|
|
|
$coo_list = Db::name('Order')->alias('o')
|
|
|
->where($where_order)
|
|
|
->join("Hire h",'h.id = o.hire_id')
|
|
|
->join("Select s",'s.id = h.select_id')
|
|
|
->join("Member m",'m.id = h.user_id')
|
|
|
->field('o.id,o.order_sn,o.status as orderStatus,o.create_time as cre,o.update_time as up , h.id as hire_id,h.* , s.name as select_name ,m.name as member_name ')
|
|
|
->order('o.create_time desc')
|
|
|
->find();
|
|
|
if($coo_list){
|
|
|
$coo_list['start_time'] = date('Y.m.d',strtotime($coo_list['start_time']));
|
|
|
$coo_list['end_time'] = date('Y.m.d',strtotime($coo_list['end_time']));
|
|
|
}
|
|
|
$this->assign('list',$coo_list);
|
|
|
return $this->fetch('ordertail');
|
|
|
}
|
|
|
|
|
|
// 我的简历
|
|
|
// 取消订单/确认完成
|
|
|
public function changeStatus(){
|
|
|
$data = $this->request->param();
|
|
|
$where_order['id'] = $data['id'];
|
|
|
if($data['type'] == 1){
|
|
|
// 取消
|
|
|
$where_order['status'] = 3;
|
|
|
}else if($data['type'] == 2){
|
|
|
// 确认完成
|
|
|
$where_order['status'] = 6;
|
|
|
}
|
|
|
$order = Db::name('Order')->where($where_order)->find();
|
|
|
if($order){
|
|
|
if($data['type'] == 1){
|
|
|
// 取消
|
|
|
$up['status'] = 5;
|
|
|
}else if($data['type'] == 2){
|
|
|
// 确认完成
|
|
|
$up['status'] = 7;
|
|
|
}
|
|
|
$up['update_time'] = time();
|
|
|
$res = Db::name('Order')->where($where_order)->update($up);
|
|
|
if($data['type'] == 1){
|
|
|
// 取消
|
|
|
$meg = '取消';
|
|
|
}else if($data['type'] == 2){
|
|
|
// 确认完成
|
|
|
$meg = '确认完成';
|
|
|
}
|
|
|
if($res){
|
|
|
$this->apiResponse('1',$meg."成功");
|
|
|
}else{
|
|
|
$this->apiResponse('0',$meg.'取消失败');
|
|
|
}
|
|
|
}else{
|
|
|
$this->apiResponse('0','状态错误');
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
// 评价
|
|
|
public function common(){
|
|
|
if($this->request->isPost()){
|
|
|
$data = $this->request->param();
|
|
|
|
|
|
}else{
|
|
|
return $this->fetch('evalute');
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
// 我的钱包
|
|
|
public function myBalance(){
|
|
|
$where_member['id'] = Session::get('uid');
|
|
|
$where_member['status'] = array('neq',9);
|
|
|
$member = Db::name('Member')->where($where_member)->find();
|
|
|
$this->assign('list',$member);
|
|
|
return $this->fetch('myremain');
|
|
|
}
|
|
|
// 我要提现
|
|
|
public function getMoney(){
|
|
|
$where_member['id'] = Session::get('uid');
|
|
|
$where_member['status'] = array('neq',9);
|
|
|
$member = Db::name('Member')->where($where_member)->find();
|
|
|
$this->assign('list',$member);
|
|
|
return $this->fetch('mybalance');
|
|
|
}
|
|
|
|
|
|
// 我的简历
|
|
|
public function myResume(){
|
|
|
$where_member['m.id'] = Session::get('uid');
|
|
|
$where_member['m.status'] = array('neq',9);
|
|
|
$member = Db::name('Member')->alias('m')
|
|
|
->join("Resume r",'r.user_id = m.id')
|
|
|
->join("Select s",'r.select_id = s.id')
|
|
|
->where($where_member)
|
|
|
->field('m.wx_name,m.wx_pic,m.name,m.tel,m.card_num,r.*')
|
|
|
->field('m.wx_name,m.wx_pic,m.name,m.tel,m.card_num,r.*,s.name as select_name,s.id as select_id')
|
|
|
->order('create_time desc')
|
|
|
->find();
|
|
|
$member['wx_pic'] = cmf_get_image_url($member['wx_pic']);
|
|
|
$member['just'] = cmf_get_image_url($member['just']);
|
|
|
$member['back'] = cmf_get_image_url($member['back']);
|
|
|
$member['skill'] = explode(',',$member['skill']);
|
|
|
$this->assign('list',$member);
|
|
|
$where_select['status'] = array('neq',9);
|
|
|
$where_select['type'] = 2;
|
|
|
$select = Db::name('Select')->where($where_select)->order('score desc,create_time desc')->select()->toArray();
|
|
|
$final['select'] = $select;
|
|
|
// 判断是否填写过
|
|
|
$where_resume['user_id'] = Session::get('uid');
|
|
|
$where_resume['status'] = array('neq',9);
|
|
|
$is_resume = Db::name('Resume')->where($where_resume)->find();
|
|
|
|
|
|
$this->assign('final',$final);
|
|
|
return $this->fetch('viae');
|
|
|
}
|
|
|
// 上传图片
|
|
|
public function getPic(){
|
|
|
$this->apiResponse('1','成功',$this->pic($_FILES)) ;
|
|
|
}
|
|
|
// 修改简历
|
|
|
public function changeResume(){
|
|
|
$data = $this->request->param();
|
|
|
$model = new ResumeModel();
|
|
|
// 用户
|
|
|
$where_member['id'] = Session::get('uid');
|
|
|
if($data['wx_pic']){
|
|
|
$add_member['wx_pic'] = $data['wx_pic'];
|
|
|
}
|
|
|
// $add_member['wx_pic'] = $data['wx_pic']?$data['wx_pic']:;
|
|
|
$add_member['name'] = $data['name'];
|
|
|
$add_member['card_num'] = $data['card_num'];
|
|
|
$add_member['update_time'] = time();
|
|
|
$res_member = Db::name('Member')->where($where_member)->update($add_member);
|
|
|
if(!$res_member){
|
|
|
$this->apiResponse('0','修改失败1');
|
|
|
}
|
|
|
// 简历
|
|
|
unset($data['wx_pic']);
|
|
|
unset($data['name']);
|
|
|
unset($data['card_num']);
|
|
|
$where_resume['user_id'] = Session::get('uid');
|
|
|
$where_resume['status'] = array('neq',9);;
|
|
|
$id = $model->where($where_resume)->order('create_time desc')->value('id');
|
|
|
if($id){
|
|
|
$where_resume['user_id'] = Session::get('uid');
|
|
|
$where_resume['status'] = array('neq',9);
|
|
|
if(!$data['just']){
|
|
|
unset($data['just']);
|
|
|
}
|
|
|
if(!$data['back']){
|
|
|
unset($data['back']);
|
|
|
}
|
|
|
$data['id'] = $id;
|
|
|
$data['status'] = 2;
|
|
|
$res = $model->isUpdate(true)->save($data);
|
|
|
if($res){
|
|
|
$this->apiResponse('1','成功');
|
|
|
}else{
|
|
|
$this->apiResponse('0','失败');
|
|
|
}
|
|
|
}else{
|
|
|
$this->apiResponse('0','简历错误');
|
|
|
}
|
|
|
|
|
|
// 关于我们
|
|
|
}
|
|
|
// 关于我们
|
|
|
public function aboutUs(){
|
|
|
$where_art['type'] = 3;
|
|
|
$where_art['status'] = array('neq',9);
|
...
|
...
|
|