Commit 781c0147 authored by 734642908@qq.com's avatar 734642908@qq.com

保存forid

parent 2f348ca5
......@@ -78,7 +78,7 @@ class AuctionController extends BaseController
,'initial_price'=>10
,'bid_price'=>10
,'enroll_price'=>10
,'start_time'=>'2018-09-19 20:00'
,'start_time'=>'2018-09-19 19:15'
,'end_time'=>''
,'status'=>'1'
)
......
......@@ -58,7 +58,49 @@ class EntryController extends BaseController
echo $this->formatRes($result);
}
//保存模板消息formid
public function templateFormid(){
$token = decryptToken(I('token'));
$formid = I('formid');
if($token == false) {
$result = array(
'c'=>2
,'msg'=>'token不正确'
);
echo $this->formatRes($result);exit;
} else if(empty($formid)) {
$result = array(
'c'=>2
,'msg'=>'formid参数不存在'
);
echo $this->formatRes($result);exit;
}
$uid = $token['uid'];
//获取用户昵称
// $sql = "select user_nickname from ".get_table("game_member")." where uid=$userid";
// $result = $GLOBALS["conn"]->Query($sql);
// $userArr = $GLOBALS["conn"]->getOne($result);
$userArr = M("game_member","",C("LEWAN_HEZI"))->where(array('uid'=>$uid))->field('user_nickname')->find();
$addArr = array(
'uid'=>$uid
,'openid'=>$token['openid']
,'nick_name'=>$userArr['user_nickname']
,'form_id'=>$formid
,'add_time'=>date('Y-m-d H:i:s')
);
// add_record($GLOBALS["conn"],"template_formid",$addArr,true);
M("yl_template_formid","",C("LEWAN_HEZI"))->add($addArr);
$result = array(
'c'=>1
,'msg'=>'保存成功'
);
echo $this->formatRes($result);exit;
}
}
......
......@@ -58,6 +58,20 @@ class WechatController extends BaseController
}
}
public function uploadMedia() {
$token = $this->getToekn();
$token = json_decode($token,true)['access_token'];
$posturl = 'https://api.weixin.qq.com/cgi-bin/media/upload?type=image&access_token='.$token;
$obj = new \CURLFile('uploadfile/lw.jpg');
//var_dump($obj);exit;
$data = array('media' => $obj);
//$data = json_encode($data);
$re = $this->curlPost($posturl,$data,true);
var_dump($re);
}
public function getToekn()
{
$filepath = 'http://ylc.test.llewan.com/wechat/retToekn';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment