mirror of
https://github.com/crmeb/CRMEB.git
synced 2025-12-11 01:52:49 +00:00
修改类名称
This commit is contained in:
parent
273e1ec0f4
commit
65bf50c49e
@ -12,9 +12,7 @@ use app\admin\model\user\UserExtract as UserExtractModel;//分销
|
||||
use app\admin\model\user\User as UserModel;//用户
|
||||
use app\admin\model\store\StoreProductReply as StoreProductReplyModel;//评论
|
||||
use app\admin\model\store\StoreProduct as ProductModel;//产品
|
||||
use crmeb\utils\Template;
|
||||
use FormBuilder\Json;
|
||||
use think\facade\Route;
|
||||
|
||||
/**
|
||||
* 首页控制器
|
||||
@ -39,22 +37,6 @@ class Index extends AuthController
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
public function test()
|
||||
{
|
||||
$res = Template::instance()->wechat()
|
||||
->setTemplateCode('OPENTM207791277')
|
||||
->setTemplateData([
|
||||
'first'=>'亲,您购买的商品已支付成功',
|
||||
'keyword1'=>'wx12545454545',
|
||||
'keyword2'=>'0.99',
|
||||
'remark'=>'点击查看订单详情'
|
||||
])
|
||||
->setTemplateOpenId('od9iXwj58C4aLy11ABMxFkgJelt0')
|
||||
->setTemplateUrl(Route::buildUrl('order/detail/wx12545454545'))
|
||||
->send();
|
||||
var_dump($res);
|
||||
}
|
||||
|
||||
//后台首页内容
|
||||
public function main()
|
||||
{
|
||||
|
||||
@ -8,7 +8,7 @@ use app\models\user\User;
|
||||
use app\models\user\UserToken;
|
||||
use app\models\user\WechatUser;
|
||||
use app\Request;
|
||||
use crmeb\utils\CanvasService;
|
||||
use crmeb\utils\Canvas;
|
||||
use crmeb\services\WechatService;
|
||||
use think\facade\Cookie;
|
||||
|
||||
@ -95,7 +95,7 @@ class WechatController
|
||||
|
||||
public function follow()
|
||||
{
|
||||
$canvas = CanvasService::instance();
|
||||
$canvas = Canvas::instance();
|
||||
$path = 'uploads/follow/';
|
||||
$imageType = 'jpg';
|
||||
$name = 'follow';
|
||||
|
||||
@ -100,33 +100,32 @@ if (!function_exists('make_path')) {
|
||||
*/
|
||||
function make_path($path, int $type = 2, bool $force = false)
|
||||
{
|
||||
$path = DS.ltrim(rtrim($path));
|
||||
switch ($type){
|
||||
$path = DS . ltrim(rtrim($path));
|
||||
switch ($type) {
|
||||
case 1:
|
||||
$path .= DS.date('Y');
|
||||
$path .= DS . date('Y');
|
||||
break;
|
||||
case 2:
|
||||
$path .= DS.date('Y').DS.date('m');
|
||||
$path .= DS . date('Y') . DS . date('m');
|
||||
break;
|
||||
case 3:
|
||||
$path .= DS.date('Y').DS.date('m').DS.date('d');
|
||||
$path .= DS . date('Y') . DS . date('m') . DS . date('d');
|
||||
break;
|
||||
}
|
||||
try{
|
||||
if (is_dir(app()->getRootPath().'public'.DS.'uploads'.$path) == true || mkdir(app()->getRootPath().'public'.DS.'uploads'.$path, 0777, true) == true) {
|
||||
return trim(str_replace(DS, '/',$path),'.');
|
||||
}else return '';
|
||||
}catch (\Exception $e){
|
||||
if($force)
|
||||
try {
|
||||
if (is_dir(app()->getRootPath() . 'public' . DS . 'uploads' . $path) == true || mkdir(app()->getRootPath() . 'public' . DS . 'uploads' . $path, 0777, true) == true) {
|
||||
return trim(str_replace(DS, '/', $path), '.');
|
||||
} else return '';
|
||||
} catch (\Exception $e) {
|
||||
if ($force)
|
||||
throw new \Exception($e->getMessage());
|
||||
return '无法创建文件夹,请检查您的上传目录权限:' . app()->getRootPath() . 'public' . DS . 'uploads' . DS. 'attach' . DS;
|
||||
return '无法创建文件夹,请检查您的上传目录权限:' . app()->getRootPath() . 'public' . DS . 'uploads' . DS . 'attach' . DS;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if(!function_exists('sysConfig'))
|
||||
{
|
||||
if (!function_exists('sysConfig')) {
|
||||
/**
|
||||
* 获取系统单个配置
|
||||
* @param string $name
|
||||
@ -134,15 +133,14 @@ if(!function_exists('sysConfig'))
|
||||
*/
|
||||
function sysConfig(string $name)
|
||||
{
|
||||
if(empty($name))
|
||||
if (empty($name))
|
||||
return null;
|
||||
|
||||
return app('sysConfig')->get($name);
|
||||
}
|
||||
}
|
||||
|
||||
if(!function_exists('sysData'))
|
||||
{
|
||||
if (!function_exists('sysData')) {
|
||||
/**
|
||||
* 获取系统单个配置
|
||||
* @param string $name
|
||||
|
||||
@ -6,8 +6,8 @@ use crmeb\traits\LogicTrait;
|
||||
use EasyWeChat\Core\Exceptions\RuntimeException;
|
||||
|
||||
/**
|
||||
* Class CanvasService
|
||||
* @package crmeb\services
|
||||
* Class Canvas
|
||||
* @package crmeb\utils
|
||||
* @method $this setFileName(string $fileName) 设置文件名
|
||||
* @method $this setPath(string $path) 设置存放路径
|
||||
* @method $this setImageType(string $imageType) 设置图片类型
|
||||
@ -30,7 +30,7 @@ use EasyWeChat\Core\Exceptions\RuntimeException;
|
||||
* @method $this setImageHeight(int $imageHeight) 设置图片高
|
||||
* @method $this setImageOpacity(int $imageOpacity) 设置图片透明度
|
||||
*/
|
||||
class CanvasService
|
||||
class Canvas
|
||||
{
|
||||
use LogicTrait;
|
||||
|
||||
@ -8,10 +8,10 @@ use Pimple\ServiceProviderInterface;
|
||||
|
||||
/**
|
||||
* 注册订阅消息
|
||||
* Class ProgramServiceProvider
|
||||
* @package crmeb\services
|
||||
* Class ProgramProvider
|
||||
* @package crmeb\utils
|
||||
*/
|
||||
class ProgramServiceProvider implements ServiceProviderInterface
|
||||
class ProgramProvider implements ServiceProviderInterface
|
||||
{
|
||||
public function register(Container $pimple)
|
||||
{
|
||||
@ -24,7 +24,7 @@ class ProgramServiceProvider implements ServiceProviderInterface
|
||||
};
|
||||
|
||||
$pimple['mini_program.now_notice'] = function ($pimple) {
|
||||
return new ProgramSubscribeService($pimple['mini_program.access_token']);
|
||||
return new ProgramSubscribe($pimple['mini_program.access_token']);
|
||||
};
|
||||
}
|
||||
}
|
||||
@ -8,8 +8,8 @@ use EasyWeChat\Core\Exceptions\InvalidArgumentException;
|
||||
|
||||
/**
|
||||
* 小程序订阅消息
|
||||
* Class ProgramSubscribeService
|
||||
* @package crmeb\services
|
||||
* Class ProgramSubscribe
|
||||
* @package crmeb\utils
|
||||
* @method $this
|
||||
* @method $this withTemplate(string $template_id) 设置模板id
|
||||
* @method $this withTemplateId(string $template_id) 设置模板id
|
||||
@ -24,7 +24,7 @@ use EasyWeChat\Core\Exceptions\InvalidArgumentException;
|
||||
* @method $this withData(array $data) 设置发送内容
|
||||
* @method $this data(array $data) 设置发送内容
|
||||
*/
|
||||
class ProgramSubscribeService extends AbstractAPI
|
||||
class ProgramSubscribe extends AbstractAPI
|
||||
{
|
||||
|
||||
/**
|
||||
@ -106,7 +106,7 @@ class Application extends Container
|
||||
ServiceProviders\OpenPlatformServiceProvider::class,
|
||||
ServiceProviders\MiniProgramServiceProvider::class,
|
||||
ServiceProviders\CommentServiceProvider::class,
|
||||
\crmeb\utils\ProgramServiceProvider::class,
|
||||
\crmeb\utils\ProgramProvider::class,
|
||||
];
|
||||
|
||||
/**
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user