You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
69 lines
2.4 KiB
69 lines
2.4 KiB
10 months ago
|
<?php
|
||
|
// +----------------------------------------------------------------------
|
||
|
// | 天诚科技 [ 刘海东 17600099397赋能开发者,助力企业发展 ]
|
||
|
// +----------------------------------------------------------------------
|
||
|
// | Copyright (c) 2016~2020 https://www.tczxkj.com All rights reserved.
|
||
|
// +----------------------------------------------------------------------
|
||
|
// | Licensed 该系统并不是自由软件,未经许可不能去掉相关版权
|
||
|
// +----------------------------------------------------------------------
|
||
|
// | Author:甘肃天诚志信电子商务有限公司 刘海东 联系电话维系17600099397
|
||
|
// +----------------------------------------------------------------------
|
||
|
|
||
|
namespace app\wap\model\user;
|
||
|
|
||
|
use service\CanvasService;
|
||
|
use think\Url;
|
||
|
use traits\ModelTrait;
|
||
|
use basic\ModelBasic;
|
||
|
use service\SystemConfigService;
|
||
|
|
||
|
/**签到海报
|
||
|
* Class SignPoster
|
||
|
* @package app\wap\model\user
|
||
|
*/
|
||
|
class SignPoster extends ModelBasic
|
||
|
{
|
||
|
use ModelTrait;
|
||
|
|
||
|
/**获取前端海报的数据
|
||
|
* @param $uid
|
||
|
* @return bool|mixed
|
||
|
*/
|
||
|
public static function todaySignPoster($uid)
|
||
|
{
|
||
|
$urls = SystemConfigService::get('site_url') . '/';
|
||
|
$url = $urls . 'wap/my/sign_in?spread_uid=' . $uid;
|
||
|
$sign_info = self::todaySignInfo();
|
||
|
if (!$sign_info['poster'] || !$sign_info) return false;
|
||
|
$sign_info['url'] = $url;
|
||
|
return $sign_info;
|
||
|
}
|
||
|
|
||
|
/**获取设置海报
|
||
|
* @return mixed
|
||
|
* @throws \think\db\exception\DataNotFoundException
|
||
|
* @throws \think\db\exception\ModelNotFoundException
|
||
|
* @throws \think\exception\DbException
|
||
|
*/
|
||
|
public static function todaySignInfo()
|
||
|
{
|
||
|
$time = strtotime(date('Y-m-d', time()));
|
||
|
$signPoster = self::order('sort DESC,id DESC')->select();
|
||
|
$signPoster = count($signPoster) > 0 ? $signPoster->toArray() : [];
|
||
|
$poster = SystemConfigService::get('sign_default_poster');
|
||
|
if (count($signPoster) > 0) {
|
||
|
foreach ($signPoster as $key => $value) {
|
||
|
if ($value['sign_time'] == $time) {
|
||
|
$poster = $value['poster'];
|
||
|
$sign_talk = $value['sign_talk'];
|
||
|
break;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
$sign_info['poster'] = isset($poster) ? $poster : '';
|
||
|
$sign_info['sign_talk'] = isset($sign_talk) ? $sign_talk : '';
|
||
|
return $sign_info;
|
||
|
}
|
||
|
|
||
|
}
|