|
|
@@ -621,75 +621,25 @@ class User extends BaseController
|
|
|
public function getWxmpQrcode(Request $request){
|
|
|
$weixinA = new weixina();
|
|
|
$data = $weixinA->getUnlimitedQRCode("pages/index/index","a=1");
|
|
|
- return app('json')->success(["data"=>$data]);
|
|
|
+ if(empty($data)){
|
|
|
+ return app('json')->fail("小程序码获取失败".$weixinA->error);
|
|
|
+ }
|
|
|
+ $base64 = 'data:'.$reponse['contentType'].';base64,'.base64_encode($data['buffer']);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ return app('json')->success(["data"=>$data,"res"=>\think\facade\Filesystem::disk('resource')]);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
/**
|
|
|
- * 发布圈子
|
|
|
- * @param Request $request
|
|
|
+ *
|
|
|
+ * @param type $code
|
|
|
+ * @param type $base64
|
|
|
*/
|
|
|
- public function upCircle(Request $request){
|
|
|
- $post = UtilService::getMore([
|
|
|
- ['id',''],
|
|
|
- ['title',''],
|
|
|
- ['content','','empty','请输入动态内容'],
|
|
|
- ['imgs',[]],
|
|
|
- ['video',''],
|
|
|
- ['video_img',''],
|
|
|
- ['video_time',0],
|
|
|
- ['pro_id',''],
|
|
|
- ],$request);
|
|
|
-
|
|
|
- $post["status"]=0;
|
|
|
+ public function uploadImageBase64($code,$base64){
|
|
|
|
|
|
- $post["imgs"] = empty($post["imgs"]) ? "" : $post["imgs"];
|
|
|
- $post["update_time"] = time();
|
|
|
- if(empty($post["imgs"]) && empty($post["video"])){
|
|
|
- return app('json')->fail("请至少上传一张主图");
|
|
|
- }
|
|
|
- if(!empty($post["imgs"])){
|
|
|
- $post["video"]="";
|
|
|
- $post["video_img"]="";
|
|
|
- $post["video_time"]=0;
|
|
|
- }
|
|
|
- if(!empty($post["video"])){
|
|
|
- $post["imgs"]="";
|
|
|
- if(empty($post["video_img"])){
|
|
|
- return app('json')->fail("视频封面错误");
|
|
|
- }
|
|
|
- if(empty($post["video_time"]) || (int)$post["video_time"]<=0){
|
|
|
- return app('json')->fail("视频时长错误");
|
|
|
- }
|
|
|
- }
|
|
|
- if(!empty($post["pro_id"])){
|
|
|
- $proData = (new Goods)->where("id",$post["pro_id"])->where("status",1)->find();
|
|
|
- if(empty($proData)){
|
|
|
- return app('json')->fail("当前商品不可选中");
|
|
|
- }
|
|
|
- }else{
|
|
|
- $post["pro_id"]=0;
|
|
|
- }
|
|
|
- $id = $post["id"];
|
|
|
- unset($post["id"]);
|
|
|
- $r=0;
|
|
|
- if(empty($id) || $id=="0"){
|
|
|
- $post["time"] = time();
|
|
|
- $post["uid"] = $request->user["uid"];
|
|
|
- $r = (new UserCircle)->insert($post);
|
|
|
- }else{
|
|
|
- $r = (new UserCircle)->where("id",$id)->update($post);
|
|
|
- }
|
|
|
- if($r){
|
|
|
- return app('json')->success("发布成功,等待客服审核。");
|
|
|
- }else{
|
|
|
- return app('json')->fail("数据保存失败");
|
|
|
- }
|
|
|
}
|
|
|
+
|
|
|
|
|
|
|
|
|
/**
|