Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
2ce270d7cf
@ -208,6 +208,7 @@ class RemoteController extends BaseApiController
|
||||
/**
|
||||
*
|
||||
* 计算两点之间的距离
|
||||
* 返回米
|
||||
*/
|
||||
function calculateDistance($longitude1, $latitude1, $longitude2, $latitude2)
|
||||
{
|
||||
@ -220,7 +221,6 @@ class RemoteController extends BaseApiController
|
||||
cos(deg2rad($latitude1)) * cos(deg2rad($latitude2)) *
|
||||
sin($dLon / 2) * sin($dLon / 2);
|
||||
$c = 2 * asin(sqrt($a));
|
||||
|
||||
return $earthRadius * $c * 100;
|
||||
return round($earthRadius * $c*1000) ;
|
||||
}
|
||||
}
|
||||
|
@ -224,6 +224,10 @@ class TaskController extends BaseApiController
|
||||
if( $parmas['terminus']['lnglat'][0]==null || $parmas['terminus']['lnglat'][0]<=0){
|
||||
return $this->fail('定位不存在');
|
||||
}
|
||||
$res = App(RemoteController::class)->calculateDistance($task['extend']['terminus']['lnglat'][][0],$task['extend']['terminus']['lnglat'][][1], $parmas['terminus']['lnglat'][0], $parmas['terminus']['lnglat'][1]);
|
||||
if($res>100){
|
||||
return $this->fail('定位坐标大于100米,请重新打卡。'.$res.'米');
|
||||
}
|
||||
$res = App(RemoteController::class)->coordinate($datas, $parmas['terminus']['lnglat'][0], $parmas['terminus']['lnglat'][1]);
|
||||
if($res===false){
|
||||
return $this->fail('定位不存在|或GPS无轨迹');
|
||||
@ -234,6 +238,10 @@ class TaskController extends BaseApiController
|
||||
if( $parmas['transfer']['lnglat'][0]==null || $parmas['transfer']['lnglat'][0]<=0){
|
||||
return $this->fail('定位不存在');
|
||||
}
|
||||
$res = App(RemoteController::class)->calculateDistance($task['extend']['transfer']['lnglat'][][0],$task['extend']['transfer']['lnglat'][][1], $parmas['terminus']['lnglat'][0], $parmas['terminus']['lnglat'][1]);
|
||||
if($res>100){
|
||||
return $this->fail('定位坐标大于100米,请重新打卡。'.$res.'米');
|
||||
}
|
||||
$res = App(RemoteController::class)->coordinate($datas, $parmas['transfer']['lnglat'][0], $parmas['transfer']['lnglat'][1]);
|
||||
if($res===false){
|
||||
return $this->fail('定位不存在|或GPS无轨迹');
|
||||
@ -248,7 +256,7 @@ class TaskController extends BaseApiController
|
||||
Task::where('id', $parmas['id'])->update($data);
|
||||
return $this->success('更新成功');
|
||||
}
|
||||
return $this->fail('定位坐标大于100米,请重新打卡');
|
||||
return $this->fail('定位坐标大于100米,请重新打卡。'.$res.'米');
|
||||
}
|
||||
|
||||
public function informationg_list()
|
||||
|
@ -244,7 +244,9 @@ class ContractLogic extends BaseLogic
|
||||
|
||||
}
|
||||
|
||||
// /**发送合同 */
|
||||
/**发送合同
|
||||
* @type 1公司 2个人
|
||||
*/
|
||||
public static function Draftingcontracts($params,$type=1)
|
||||
{
|
||||
if($type==1){
|
||||
@ -252,6 +254,7 @@ class ContractLogic extends BaseLogic
|
||||
}else{
|
||||
$result = UserLogic::detail($params['id']);
|
||||
}
|
||||
$result['contract']= Contract::where('id',$params['contract_id'])->with(['party_a_info', 'contractType'])->find();
|
||||
if ($result && isset($result['contract']) && isset($result['contract']['file']) && $result['contract']['file'] != '') {
|
||||
if ($result['contract']['check_status'] == 3) {
|
||||
return self::setError('你已经生成过合同,请勿重复生成');
|
||||
|
@ -6,5 +6,12 @@ use app\common\model\BaseModel;
|
||||
|
||||
class UserInformationgDemand extends BaseModel
|
||||
{
|
||||
public function getDataAttr($value)
|
||||
{
|
||||
if($value){
|
||||
return json_decode($value,true);
|
||||
}
|
||||
return [];
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -19,11 +19,8 @@ namespace IFlytek\Xfyun\Speech;
|
||||
|
||||
use IFlytek\Xfyun\Core\Traits\SignTrait;
|
||||
use IFlytek\Xfyun\Core\HttpClient;
|
||||
use GuzzleHttp\Psr7\Request;
|
||||
use IFlytek\Xfyun\Speech\Constants\ChatConstants;
|
||||
|
||||
/**
|
||||
* 文本纠错客户端
|
||||
* 讯飞Ai户端
|
||||
*
|
||||
* @author guizheng@iflytek.com
|
||||
*/
|
||||
@ -87,4 +84,37 @@ class ChatClient
|
||||
));
|
||||
return $authAddr;
|
||||
}
|
||||
|
||||
function getBody($appid, $question)
|
||||
{
|
||||
$header = array(
|
||||
"app_id" => $appid,
|
||||
"uid" => "1"
|
||||
);
|
||||
|
||||
$parameter = array(
|
||||
"chat" => array(
|
||||
"domain" => "generalv2",
|
||||
"temperature" => 0.5,
|
||||
"max_tokens" => 1024
|
||||
)
|
||||
);
|
||||
|
||||
$payload = array(
|
||||
"message" => array(
|
||||
"text" => array(
|
||||
array("role" => "user", "content" => $question)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
$json_string = json_encode(array(
|
||||
"header" => $header,
|
||||
"parameter" => $parameter,
|
||||
"payload" => $payload
|
||||
));
|
||||
|
||||
return $json_string;
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user