Commit 32bb00c8 authored by zhuwei's avatar zhuwei

小程序2

# Conflicts: # application/api_broker/service/LookShopService.php
parent 89b19110
......@@ -15,6 +15,7 @@ use app\api\extend\Basic;
use app\api\service\RegisterService;
use app\api\service\WxSdkService;
use app\api\untils\JwtUntils;
use app\model\TLookShopUser;
use app\model\Users;
use app\model\UWxInfo;
use think\Exception;
......@@ -177,7 +178,7 @@ class WxSdk extends Basic
}
/**
* 保存微信登录信息
* 小程序保存微信登录信息
* @return \think\Response
*/
public function saveWXInfoByPortableProgram()
......@@ -214,6 +215,7 @@ class WxSdk extends Basic
}
if ($id > 0 ) {
$this->addUserLookShopV2($id,$params['house_id'],$params['source'],1);
return $this->response("200", "request success");
} else{
return $this->response("101", "request exception");
......@@ -221,4 +223,40 @@ class WxSdk extends Basic
}
/**
* 保存看铺数据
* @param $user_id
* @param $house_id
* @param $type
* @param $source
* @return bool
*/
public function addUserLookShopV2($user_id,$house_id,$type,$source)
{
$day = date("Y-m-d", time());
$tModel = new TLookShopUser();
$params["user_id"] = $user_id;
$params["type"] = $type;
$params["house_id"] = $house_id;
$params["look_day"] = $day;
$params["source"] = $day;
$result = $tModel->getList($params, "a.id", 1, 1);
if (count($result) > 0) {
return false;
}
$arr = array(
"user_id" => $user_id,
"type" => $type,
"house_id" => $house_id,
"look_day" => $day,
"source" => $day,
"create_time" => date("Y-m-d H:i:s", time()),
"update_time" => date("Y-m-d H:i:s", time()),
);
$tModel->addLookShop($arr);
return true;
}
}
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