mirror of
https://github.com/crmeb/CRMEB.git
synced 2025-12-12 19:12:49 +00:00
提交3.1 版本
This commit is contained in:
parent
9410c1710a
commit
bd462f823b
@ -1,3 +1,3 @@
|
||||
<?php
|
||||
define('INSTALL_DATE',1571990119);
|
||||
define('SERIALNUMBER','nsBVPi');
|
||||
define('INSTALL_DATE',1567993973);
|
||||
define('SERIALNUMBER','BaoWxF');
|
||||
8
crmeb/.htaccess
Normal file
8
crmeb/.htaccess
Normal file
@ -0,0 +1,8 @@
|
||||
<IfModule mod_rewrite.c>
|
||||
Options +FollowSymlinks -Multiviews
|
||||
RewriteEngine On
|
||||
|
||||
RewriteCond %{REQUEST_FILENAME} !-d
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
|
||||
</IfModule>
|
||||
@ -1,2 +1,2 @@
|
||||
version=CRMEB-DT v3.1
|
||||
version_code=133
|
||||
version=CRMEB-DT v3.1.1
|
||||
version_code=134
|
||||
@ -2,6 +2,8 @@
|
||||
|
||||
namespace app;
|
||||
|
||||
use crmeb\services\SystemConfigService;
|
||||
use crmeb\services\GroupDataService;
|
||||
use crmeb\utils\Json;
|
||||
use think\facade\Db;
|
||||
use think\Service;
|
||||
@ -10,7 +12,9 @@ class AppService extends Service
|
||||
{
|
||||
|
||||
public $bind = [
|
||||
'json' => Json::class
|
||||
'json' => Json::class,
|
||||
'sysConfig' => SystemConfigService::class,
|
||||
'sysGroupData' => GroupDataService::class
|
||||
];
|
||||
|
||||
public function boot()
|
||||
|
||||
20
crmeb/app/admin/config/view.php
Normal file
20
crmeb/app/admin/config/view.php
Normal file
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | 模板设置
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
return [
|
||||
// 模板后缀
|
||||
'view_suffix' => 'php',
|
||||
// 模板路径
|
||||
'view_path' => app_path('view'),
|
||||
// 视图输出字符串内容替换
|
||||
'tpl_replace_string' => [
|
||||
'{__PUBLIC_PATH}' => '/', //public 目录
|
||||
'{__STATIC_PATH}' => '/static/', //全局静态目录
|
||||
'{__PLUG_PATH}' => '/static/plug/', //全局静态插件
|
||||
'{__ADMIN_PATH}' => '/system/', //后台目录
|
||||
'{__FRAME_PATH}' => '/system/frame/', //后台框架
|
||||
'{__MODULE_PATH}' => '/system/module/', //后台模块
|
||||
]
|
||||
];
|
||||
@ -37,11 +37,11 @@ class AuthController extends SystemBasic
|
||||
protected function initialize()
|
||||
{
|
||||
parent::initialize();
|
||||
if(!SystemAdmin::hasActiveAdmin()) return $this->redirect('Login/index');
|
||||
if(!SystemAdmin::hasActiveAdmin()) return $this->redirect(Url::buildUrl('login/index')->suffix(false)->build());
|
||||
try{
|
||||
$adminInfo = SystemAdmin::activeAdminInfoOrFail();
|
||||
}catch (\Exception $e){
|
||||
return $this->failed(SystemAdmin::getErrorInfo($e->getMessage()),Url::buildUrl('Login/index'));
|
||||
return $this->failed(SystemAdmin::getErrorInfo($e->getMessage()),Url::buildUrl('login/index')->suffix(false)->build());
|
||||
}
|
||||
$this->adminInfo = $adminInfo;
|
||||
$this->adminId = $adminInfo['id'];
|
||||
@ -58,7 +58,7 @@ class AuthController extends SystemBasic
|
||||
{
|
||||
static $allAuth = null;
|
||||
if($allAuth === null) $allAuth = SystemRole::getAllAuth();
|
||||
if($module === null) $module = $this->request->app();
|
||||
if($module === null) $module = app('http')->getName();
|
||||
if($controller === null) $controller = $this->request->controller();
|
||||
if($action === null) $action = $this->request->action();
|
||||
if(!count($route)) $route = $this->request->route();
|
||||
|
||||
@ -12,9 +12,9 @@ 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 app\models\store\StoreOrder;
|
||||
use crmeb\services\SystemConfigService;
|
||||
use crmeb\utils\Template;
|
||||
use FormBuilder\Json;
|
||||
use think\facade\Route;
|
||||
|
||||
/**
|
||||
* 首页控制器
|
||||
@ -33,12 +33,29 @@ class Index extends AuthController
|
||||
$this->assign([
|
||||
'menuList'=>SystemMenus::menuList(),
|
||||
'site_logo'=>json_decode($site_logo['value'],true),
|
||||
'new_order_audio_link'=>SystemConfigService::get('new_order_audio_link'),
|
||||
'new_order_audio_link'=>sysConfig('new_order_audio_link'),
|
||||
'role_name'=>SystemRole::where('id',$roles[0])->field('role_name')->find()
|
||||
]);
|
||||
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()
|
||||
{
|
||||
/*首页第一行统计*/
|
||||
|
||||
@ -39,11 +39,13 @@ class Login extends SystemBasic
|
||||
$res = SystemAdmin::login($account,$pwd);
|
||||
if($res){
|
||||
Session::set('login_error',null);
|
||||
return $this->redirect(Url::buildUrl('Index/index'));
|
||||
Session::save();
|
||||
return $this->successful(['url'=>Url::buildUrl('Index/index')->build()]);
|
||||
}else{
|
||||
$error['num'] += 1;
|
||||
$error['time'] = time();
|
||||
Session::set('login_error',$error);
|
||||
Session::save();
|
||||
return $this->failed(SystemAdmin::getErrorInfo('用户名错误,请重新输入'));
|
||||
}
|
||||
}
|
||||
@ -60,6 +62,6 @@ class Login extends SystemBasic
|
||||
public function logout()
|
||||
{
|
||||
SystemAdmin::clearLoginInfo();
|
||||
$this->redirect('Login/index');
|
||||
$this->redirect(Url::buildUrl('index')->build());
|
||||
}
|
||||
}
|
||||
@ -27,7 +27,7 @@ class AgentManage extends AuthController
|
||||
public function index()
|
||||
{
|
||||
$this->assign( 'year',getMonth());
|
||||
$this->assign('store_brokerage_statu',\crmeb\services\SystemConfigService::get('store_brokerage_statu'));
|
||||
$this->assign('store_brokerage_statu',sysConfig('store_brokerage_statu'));
|
||||
return $this->fetch();
|
||||
}
|
||||
public function get_spread_list()
|
||||
@ -276,10 +276,7 @@ class AgentManage extends AuthController
|
||||
public function empty_spread($uid=0)
|
||||
{
|
||||
if(!$uid) return JsonService::fail('缺少参数');
|
||||
$res=true;
|
||||
$spread_uid = User::where('spread_uid',$uid)->column('uid','uid');
|
||||
if(count($spread_uid)) $res = $res && false !== User::where('spread_uid','in',$spread_uid)->update(['spread_uid'=>0]);
|
||||
$res = $res && false !== User::where('spread_uid',$uid)->update(['spread_uid'=>0]);
|
||||
$res = User::where('uid',$uid)->update(['spread_uid'=>0]);
|
||||
if($res)
|
||||
return JsonService::successful('清除成功');
|
||||
else
|
||||
|
||||
@ -54,7 +54,7 @@ class WechatNews extends AuthController
|
||||
$news['url'] = '';
|
||||
$news['cid'] = array();
|
||||
if($id){
|
||||
$news = \app\admin\model\wechat\WechatNews::where('n.id',$id)->alias('n')->field('n.*,c.content')->join('__WECHAT_NEWS_CONTENT__ c','c.nid=n.id')->find();
|
||||
$news = \app\admin\model\wechat\WechatNews::where('n.id',$id)->alias('n')->field('n.*,c.content')->join('wechat_news_content c','c.nid=n.id')->find();
|
||||
if(!$news) return $this->failedNotice('数据不存在!');
|
||||
$news['cid'] = explode(',',$news['cid']);
|
||||
// dump($news);
|
||||
|
||||
@ -124,7 +124,7 @@ SCRIPT;
|
||||
'keyword2'=>$UserRecharge['price'],
|
||||
'keyword3'=>date('Y-m-d H:i:s',$UserRecharge['add_time']),
|
||||
'remark'=>'点击查看订单详情'
|
||||
],Url::buildUrl('wap/My/balance','',true,true));
|
||||
],Url::buildUrl('/user/bill/2')->suffix(false)->build());
|
||||
break;
|
||||
case 'routine':
|
||||
RoutineTemplate::sendOut('ORDER_REFUND_SUCCESS',$UserRecharge['uid'],[
|
||||
|
||||
@ -109,6 +109,10 @@ class StoreOrder extends AuthController
|
||||
}
|
||||
$orderInfo->status = 2;
|
||||
if($orderInfo->save()) {
|
||||
OrderRepository::storeProductOrderTakeDeliveryAdmin($orderInfo);
|
||||
StoreOrderStatus::setStatus($orderInfo->id,'take_delivery','已核销');
|
||||
//发送短信
|
||||
event('ShortMssageSend',[$orderInfo['order_id'],'Receiving']);
|
||||
StoreOrderModel::commitTrans();
|
||||
return JsonService::successful('核销成功!');
|
||||
}else {
|
||||
@ -475,7 +479,7 @@ class StoreOrder extends AuthController
|
||||
$refund_data['pay_price'] = $product['pay_price'];
|
||||
$refund_data['refund_price'] = $refund_price;
|
||||
if($product['pay_type'] == 'weixin'){
|
||||
if($product['is_channel']){//小程序
|
||||
if($product['is_channel'] == 1){//小程序
|
||||
try{
|
||||
MiniProgramService::payOrderRefund($product['order_id'],$refund_data);//2.5.36
|
||||
}catch(\Exception $e){
|
||||
@ -717,6 +721,9 @@ class StoreOrder extends AuthController
|
||||
$res = $res1 && $res2;
|
||||
BaseModel::checkTrans($res);
|
||||
if(!$res) return Json::fail('退积分失败!');
|
||||
if($product['pay_price'] == 0 && $bj == 0){
|
||||
$data['refund_status'] = 2;
|
||||
}
|
||||
StoreOrderModel::edit($data,$id);
|
||||
StoreOrderStatus::setStatus($id,'integral_back','商品退积分:'.$data['back_integral']);
|
||||
return Json::successful('退积分成功!');
|
||||
|
||||
@ -327,7 +327,7 @@ class CombinationOrder extends AuthController
|
||||
$refund_data['pay_price'] = $product['pay_price'];
|
||||
$refund_data['refund_price'] = $refund_price;
|
||||
if($product['pay_type'] == 'weixin'){
|
||||
if($product['is_channel']){//TODO 小程序
|
||||
if($product['is_channel'] == 1){//TODO 小程序
|
||||
try{
|
||||
MiniProgramService::payOrderRefund($product['order_id'],$refund_data);//2.5.36
|
||||
}catch(\Exception $e){
|
||||
|
||||
@ -176,7 +176,7 @@ class SystemAdmin extends AuthController
|
||||
* 个人资料 展示
|
||||
* @return string
|
||||
*/
|
||||
public function adminInfo(){
|
||||
public function admin_info(){
|
||||
$adminInfo = $this->adminInfo;//获取当前登录的管理员
|
||||
$this->assign('adminInfo',$adminInfo);
|
||||
return $this->fetch();
|
||||
|
||||
@ -1,6 +1,8 @@
|
||||
<?php
|
||||
namespace app\admin\controller\setting;
|
||||
|
||||
use crmeb\services\CacheService;
|
||||
use crmeb\services\SystemConfigService;
|
||||
use think\facade\Route as Url;
|
||||
use crmeb\services\FormBuilder as Form;
|
||||
use crmeb\services\UtilService as Util;
|
||||
@ -223,6 +225,7 @@ class SystemConfig extends AuthController
|
||||
$data['value'] = json_encode($data['value']);
|
||||
}
|
||||
ConfigModel::create($data);
|
||||
CacheService::delete(SystemConfigService::CACHE_SYSTEM);
|
||||
return Json::successful('添加菜单成功!');
|
||||
}
|
||||
|
||||
@ -343,10 +346,12 @@ class SystemConfig extends AuthController
|
||||
*/
|
||||
public function delete_config(){
|
||||
$id = input('id');
|
||||
if(!ConfigModel::del($id))
|
||||
if(!ConfigModel::del($id)) {
|
||||
return Json::fail(ConfigModel::getErrorInfo('删除失败,请稍候再试!'));
|
||||
else
|
||||
}else {
|
||||
CacheService::delete(SystemConfigService::CACHE_SYSTEM);
|
||||
return Json::successful('删除成功!');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -371,6 +376,7 @@ class SystemConfig extends AuthController
|
||||
foreach ($post as $k=>$v){
|
||||
ConfigModel::edit(['value' => json_encode($v)],$k,'menu_name');
|
||||
}
|
||||
CacheService::delete(SystemConfigService::CACHE_SYSTEM);
|
||||
return $this->successful('修改成功');
|
||||
}
|
||||
}
|
||||
|
||||
@ -42,7 +42,7 @@ class SystemConfigTab extends AuthController
|
||||
$tab_id = input('tab_id');
|
||||
if(!$tab_id) return Json::fail('参数错误');
|
||||
$this->assign('tab_id',$tab_id);
|
||||
$list = ConfigModel::getAll($tab_id);
|
||||
$list = ConfigModel::getAll($tab_id,2);
|
||||
foreach ($list as $k=>$v){
|
||||
$list[$k]['value'] = json_decode($v['value'],true)?:'';
|
||||
if($v['type'] == 'radio' || $v['type'] == 'checkbox'){
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
|
||||
namespace app\admin\controller\setting;
|
||||
|
||||
use crmeb\services\CacheService;
|
||||
use crmeb\services\FormBuilder as Form;
|
||||
use crmeb\services\JsonService as Json;
|
||||
use crmeb\services\UploadService as Upload;
|
||||
@ -122,6 +123,7 @@ class SystemGroupData extends AuthController
|
||||
|
||||
$data = array("gid"=>$gid,"add_time"=>time(),"value"=>json_encode($value),"sort"=>$params["sort"],"status"=>$params["status"]);
|
||||
GroupDataModel::create($data);
|
||||
CacheService::clear();
|
||||
return Json::successful('添加数据成功!');
|
||||
}
|
||||
|
||||
@ -231,6 +233,7 @@ class SystemGroupData extends AuthController
|
||||
}
|
||||
$data = array("value"=>json_encode($value),"sort"=>$params["sort"],"status"=>$params["status"]);
|
||||
GroupDataModel::edit($data,$id);
|
||||
CacheService::clear();
|
||||
return Json::successful('修改成功!');
|
||||
}
|
||||
|
||||
@ -244,8 +247,10 @@ class SystemGroupData extends AuthController
|
||||
{
|
||||
if(!GroupDataModel::del($id))
|
||||
return Json::fail(GroupDataModel::getErrorInfo('删除失败,请稍候再试!'));
|
||||
else
|
||||
else {
|
||||
CacheService::clear();
|
||||
return Json::successful('删除成功!');
|
||||
}
|
||||
}
|
||||
|
||||
public function upload()
|
||||
|
||||
@ -26,14 +26,14 @@ class SmsAdmin extends AuthController
|
||||
|
||||
public function captcha()
|
||||
{
|
||||
if (!request()->isPost()) return JsonService::fail('发生失败');
|
||||
if (!request()->isPost()) return JsonService::fail('发送失败');
|
||||
$phone = request()->param('phone');
|
||||
if (!trim($phone)) return JsonService::fail('请填写手机号');
|
||||
|
||||
$res = json_decode(HttpService::getRequest(SMSService::code(), compact('phone')), true);
|
||||
if (!isset($res['status']) && $res['status'] !== 200)
|
||||
return JsonService::fail(isset($res['data']['message']) ? $res['data']['message'] : $res['msg']);
|
||||
return JsonService::success(isset($res['data']['message']) ? $res['data']['message'] : $res['msg']);
|
||||
return JsonService::success(isset($res['data']['message']) ? $res['data']['message'] : '发送成功');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -53,6 +53,7 @@ class SmsTemplateApply extends AuthController
|
||||
{
|
||||
$field = [
|
||||
FormBuilder::input('title','模板名称'),
|
||||
FormBuilder::textarea('text','模板内容示例','【您的短信签名】您的验证码是:{$code},有效期为{$time}分钟。如非本人操作,可不用理会。模板中的{$code}和{$time}需要替换成对应的变量,请开发者知晓。修改此项无效!'),
|
||||
FormBuilder::input('content','模板内容')->type('textarea'),
|
||||
FormBuilder::radio('type','模板类型',1)->options([['label'=>'验证码','value'=>1],['label'=>'通知','value'=>2],['label'=>'推广','value'=>3]])
|
||||
];
|
||||
|
||||
@ -30,18 +30,6 @@ class CopyTaobao extends AuthController
|
||||
|
||||
use CurdControllerTrait;
|
||||
|
||||
//cookie 采集前请配置自己的 cookie,获取方式浏览器登录平台,F12或查看元素 network->headers 查看Request Headers 复制cookie 到下面变量中
|
||||
protected $webcookie = [
|
||||
//淘宝
|
||||
'taobao' =>'cookie: miid=8289590761042824660; thw=cn; cna=bpdDExs9KGgCAXuLszWnEXxS; hng=CN%7Czh-CN%7CCNY%7C156; tracknick=taobaorongyao; _cc_=WqG3DMC9EA%3D%3D; tg=0; enc=WQPStocTopRI3wEBOPpj8VUDkqSw4Ph81ASG9053SgG8xBMzaOuq6yMe8KD4xPBlNfQST7%2Ffsk9M9GDtGmn6iQ%3D%3D; t=4bab065740d964a05ad111f5057078d4; cookie2=1965ea371faf24b163093f31af4120c2; _tb_token_=5d3380e119d6e; v=0; mt=ci%3D-1_1; _m_h5_tk=61bf01c61d46a64c98209a7e50e9e1df_1572349453522; _m_h5_tk_enc=9d9adfcbd7af7e2274c9b331dc9bae9b; l=dBgc_jG4vxuski7DBOCgCuI8aj7TIIRAguPRwN0viOCKUxT9CgCDAJt5v8PWVNKO7t1nNetzvui3udLHRntW6KTK6MK9zd9snxf..; isg=BJWVXJ3FZGyiWUENfGCuywlwpJePOkncAk8hmRc6WoxbbrVg3-Jadf0uODL97mFc',
|
||||
//阿里巴巴 1688
|
||||
'alibaba' =>'',
|
||||
//天猫 可以和淘宝一样
|
||||
'tmall' =>'cookie: miid=8289590761042824660; thw=cn; cna=bpdDExs9KGgCAXuLszWnEXxS; hng=CN%7Czh-CN%7CCNY%7C156; tracknick=taobaorongyao; _cc_=WqG3DMC9EA%3D%3D; tg=0; enc=WQPStocTopRI3wEBOPpj8VUDkqSw4Ph81ASG9053SgG8xBMzaOuq6yMe8KD4xPBlNfQST7%2Ffsk9M9GDtGmn6iQ%3D%3D; t=4bab065740d964a05ad111f5057078d4; cookie2=1965ea371faf24b163093f31af4120c2; _tb_token_=5d3380e119d6e; v=0; mt=ci%3D-1_1; _m_h5_tk=61bf01c61d46a64c98209a7e50e9e1df_1572349453522; _m_h5_tk_enc=9d9adfcbd7af7e2274c9b331dc9bae9b; l=dBgc_jG4vxuski7DBOCgCuI8aj7TIIRAguPRwN0viOCKUxT9CgCDAJt5v8PWVNKO7t1nNetzvui3udLHRntW6KTK6MK9zd9snxf..; isg=BJWVXJ3FZGyiWUENfGCuywlwpJePOkncAk8hmRc6WoxbbrVg3-Jadf0uODL97mFc',
|
||||
//京东 可不用配置
|
||||
'jd' =>''
|
||||
];
|
||||
|
||||
protected $bindModel = ProductModel::class;
|
||||
//错误信息
|
||||
protected $errorInfo = true;
|
||||
@ -75,8 +63,6 @@ class CopyTaobao extends AuthController
|
||||
//远程下载附件图片分类名称
|
||||
protected $AttachmentCategoryName = '远程下载';
|
||||
|
||||
//请求平台名称 taobao alibaba tmall jd
|
||||
protected $webnname = 'taobao';
|
||||
/**
|
||||
* 显示资源
|
||||
* @return html
|
||||
@ -127,7 +113,6 @@ class CopyTaobao extends AuthController
|
||||
$url = $this->checkurl($link);
|
||||
if ($url === false) return JsonService::fail($this->errorInfo);
|
||||
$this->errorInfo = true;
|
||||
$url .= '&ra='.rand(2222222,9999999);
|
||||
$html = $this->curl_Get($url, 60);
|
||||
if (!$html) return JsonService::fail('商品HTML信息获取失败');
|
||||
$html = $this->Utf8String($html);
|
||||
@ -167,7 +152,6 @@ class CopyTaobao extends AuthController
|
||||
* */
|
||||
public function setProductInfoTaobao($html)
|
||||
{
|
||||
$this->webnname = 'taobao';
|
||||
//获取轮播图
|
||||
$images = $this->getTaobaoImg($html);
|
||||
$images = array_merge($images);
|
||||
@ -176,7 +160,7 @@ class CopyTaobao extends AuthController
|
||||
//获取产品详情请求链接
|
||||
$link = $this->getTaobaoDesc($html);
|
||||
//获取请求内容
|
||||
$desc_json = $this->curl_Get($link,60);
|
||||
$desc_json = HttpService::getRequest($link);
|
||||
//转换字符集
|
||||
$desc_json = $this->Utf8String($desc_json);
|
||||
//截取掉多余字符
|
||||
@ -197,7 +181,6 @@ class CopyTaobao extends AuthController
|
||||
* */
|
||||
public function setProductInfoTmall($html)
|
||||
{
|
||||
$this->webnname = 'tmall';
|
||||
//获取轮播图
|
||||
$images = $this->getTianMaoImg($html);
|
||||
$images = array_merge($images);
|
||||
@ -207,8 +190,7 @@ class CopyTaobao extends AuthController
|
||||
//获取产品详情请求链接
|
||||
$link = $this->getTianMaoDesc($html);
|
||||
//获取请求内容
|
||||
$desc_json = $this->curl_Get($link,60);
|
||||
// $desc_json = HttpService::getRequest($link);
|
||||
$desc_json = HttpService::getRequest($link);
|
||||
//转换字符集
|
||||
$desc_json = $this->Utf8String($desc_json);
|
||||
//截取掉多余字符
|
||||
@ -227,7 +209,6 @@ class CopyTaobao extends AuthController
|
||||
* */
|
||||
public function setProductInfo1688($html)
|
||||
{
|
||||
$this->webnname = 'alibaba';
|
||||
//获取轮播图
|
||||
$images = $this->get1688Img($html);
|
||||
if (isset($images['gaoqing'])) {
|
||||
@ -240,8 +221,7 @@ class CopyTaobao extends AuthController
|
||||
//获取产品详情请求链接
|
||||
$link = $this->get1688Desc($html);
|
||||
//获取请求内容
|
||||
$desc_json = $this->curl_Get($link,60);
|
||||
// $desc_json = HttpService::getRequest($link);
|
||||
$desc_json = HttpService::getRequest($link);
|
||||
//转换字符集
|
||||
$desc_json = $this->Utf8String($desc_json);
|
||||
$this->productInfo['test'] = $desc_json;
|
||||
@ -263,7 +243,6 @@ class CopyTaobao extends AuthController
|
||||
* */
|
||||
public function setProductInfoJd($html)
|
||||
{
|
||||
$this->webnname = 'jd';
|
||||
//获取产品详情请求链接
|
||||
$desc_url = $this->getJdDesc($html);
|
||||
//获取请求内容
|
||||
@ -358,7 +337,8 @@ class CopyTaobao extends AuthController
|
||||
if (!$AttachmentCategory) $AttachmentCategory = SystemAttachmentCategory::create(['pid' => '0', 'name' => $this->AttachmentCategoryName, 'enname' => '']);
|
||||
//生成附件目录
|
||||
try{
|
||||
if (make_path('attach', 3) == '') return JsonService::fail('无法创建文件夹,请检查您的上传目录权限:' . app()->getRootPath() . 'public' . DS . 'uploads' . DS. 'attach' . DS);
|
||||
if (make_path('attach', 3,true) === '')
|
||||
return JsonService::fail('无法创建文件夹,请检查您的上传目录权限:' . app()->getRootPath() . 'public' . DS . 'uploads' . DS. 'attach' . DS);
|
||||
|
||||
}catch (\Exception $e){
|
||||
return JsonService::fail($e->getMessage().'或无法创建文件夹,请检查您的上传目录权限:' . app()->getRootPath() . 'public' . DS . 'uploads' . DS. 'attach' . DS);
|
||||
@ -701,10 +681,18 @@ class CopyTaobao extends AuthController
|
||||
//获取淘宝商品描述
|
||||
public function getTaobaoDesc($html = '')
|
||||
{
|
||||
preg_match("/dscnew.taobao.com.+?'/i", $html, $descarr);
|
||||
$url = substr($descarr[0],0,-1);
|
||||
preg_match('/descUrl([^<>]*)counterApi/', $html, $descarr);
|
||||
if (!isset($descarr[1])) return '';
|
||||
$arr = explode(':', $descarr[1]);
|
||||
$url = [];
|
||||
foreach ($arr as $k => $v) {
|
||||
if (strpos($v, '//')) {
|
||||
$str = str_replace(['\'', ',', ' ', '?', ':'], '', $v);
|
||||
$url[] = trim($str);
|
||||
}
|
||||
}
|
||||
if ($url) {
|
||||
return 'https://'.$url;
|
||||
return strpos($url[0], 'http') ? $url[0] : 'http:' . $url[0];
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
@ -718,19 +706,13 @@ class CopyTaobao extends AuthController
|
||||
{
|
||||
if (!$url) return '';
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // 跳过证书检查
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // 跳过证书检查
|
||||
if (stripos($url, "https://") !== FALSE) {
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); // 从证书中检查SSL加密算法是否存在
|
||||
}
|
||||
$headers = ['user-agent:Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36'];
|
||||
if($this->webnname){
|
||||
$headers[] = $this->webcookie["$this->webnname"];
|
||||
}
|
||||
|
||||
curl_setopt($ch, CURLOPT_URL, $url);
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, array('user-agent:' . $_SERVER['HTTP_USER_AGENT']));
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt ($ch, CURLOPT_REFERER, "www.crmeb.com");
|
||||
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
|
||||
curl_setopt($ch, CURLOPT_TIMEOUT, $time_out);
|
||||
$response = curl_exec($ch);
|
||||
|
||||
@ -52,7 +52,9 @@ class StoreProduct extends AuthController
|
||||
//已经售馨产品
|
||||
$outofstock = ProductModel::getModelObject()->where(ProductModel::setData(4))->count();
|
||||
//警戒库存
|
||||
$policeforce =ProductModel::getModelObject()->where(ProductModel::setData(5))->count();
|
||||
$store_stock = sysConfig('store_stock');
|
||||
if($store_stock < 0) $store_stock = 2;
|
||||
$policeforce =ProductModel::getModelObject()->where(ProductModel::setData(5))->where('p.stock','<=',$store_stock)->count();
|
||||
//回收站
|
||||
$recycle = ProductModel::where('is_del',1)->count();
|
||||
if($type == null) $type = 1;
|
||||
|
||||
@ -30,7 +30,7 @@ class SystemAttachment extends AuthController
|
||||
$info["size"] = $res['size'];
|
||||
$info["type"] = $res['type'];
|
||||
$info["state"] = "SUCCESS";
|
||||
if($res['image_type'] == 1) $info['url'] = SystemConfigService::get('site_url').str_replace('\\','/',$res['dir']);
|
||||
if($res['image_type'] == 1) $info['url'] = sysConfig('site_url').str_replace('\\','/',$res['dir']);
|
||||
}else
|
||||
$info = array(
|
||||
"msg" => $res,
|
||||
|
||||
@ -10,6 +10,7 @@ namespace app\admin\controller\system;
|
||||
|
||||
|
||||
use app\admin\controller\AuthController;
|
||||
use app\admin\model\store\StoreProduct;
|
||||
use crmeb\services\JsonService as Json;
|
||||
use think\facade\Db;
|
||||
|
||||
@ -131,6 +132,24 @@ class SystemclearData extends AuthController
|
||||
self::clearData('system_log',1);
|
||||
return Json::successful('清除数据成功!');
|
||||
}
|
||||
|
||||
/**
|
||||
* 清除数据
|
||||
* @param int $type
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function undata($type = 1)
|
||||
{
|
||||
switch ((int)$type){
|
||||
case 1:
|
||||
\app\admin\model\system\SystemAttachment::where('module_type',2)->delete();
|
||||
break;
|
||||
case 2:
|
||||
StoreProduct::where('is_del',1)->delete();
|
||||
break;
|
||||
}
|
||||
return Json::successful('清除数据成功!');
|
||||
}
|
||||
//清除制定表数据
|
||||
public function clearData($table_name,$status){
|
||||
$table_name = config('database.connections.' . config('database.default'))['prefix'].$table_name;
|
||||
|
||||
@ -106,12 +106,11 @@ class SystemFile extends AuthController
|
||||
|
||||
public function index()
|
||||
{
|
||||
$app = $this->getDir('./application');
|
||||
$extend = $this->getDir('./extend');
|
||||
$public = $this->getDir('./public');
|
||||
$rootPath = app()->getRootPath();
|
||||
$app = $this->getDir($rootPath.'app');
|
||||
$extend = $this->getDir($rootPath.'crmeb');
|
||||
$arr = array();
|
||||
$arr = array_merge($app, $extend);
|
||||
$arr = array_merge($arr, $public);
|
||||
$fileAll = array();//本地文件
|
||||
$cha = array();//不同的文件
|
||||
foreach ($arr as $k => $v) {
|
||||
@ -122,7 +121,7 @@ class SystemFile extends AuthController
|
||||
$cthash = md5($ct);
|
||||
$update_time = stat($v);
|
||||
$fileAll[$k]['cthash'] = $cthash;
|
||||
$fileAll[$k]['filename'] = $v;
|
||||
$fileAll[$k]['filename'] = str_replace($rootPath,'',$v);
|
||||
$fileAll[$k]['atime'] = $update_time['atime'];
|
||||
$fileAll[$k]['mtime'] = $update_time['mtime'];
|
||||
$fileAll[$k]['ctime'] = $update_time['ctime'];
|
||||
@ -149,7 +148,7 @@ class SystemFile extends AuthController
|
||||
foreach ($fileAll as $ko => $vo) {
|
||||
if ($v['filename'] == $vo['filename']) {
|
||||
if ($v['cthash'] != $vo['cthash']) {
|
||||
$cha[$k]['filename'] = $v['filename'];
|
||||
$cha[$k]['filename'] = str_replace($rootPath,'',$v['filename']);
|
||||
$cha[$k]['cthash'] = $v['cthash'];
|
||||
$cha[$k]['atime'] = $v['atime'];
|
||||
$cha[$k]['mtime'] = $v['mtime'];
|
||||
@ -163,7 +162,7 @@ class SystemFile extends AuthController
|
||||
|
||||
}
|
||||
foreach ($file as $k => $v) {
|
||||
$cha[$k]['filename'] = $v['filename'];
|
||||
$cha[$k]['filename'] = str_replace($rootPath,'',$v['filename']);
|
||||
$cha[$k]['cthash'] = $v['cthash'];
|
||||
$cha[$k]['atime'] = $v['atime'];
|
||||
$cha[$k]['mtime'] = $v['mtime'];
|
||||
@ -171,7 +170,7 @@ class SystemFile extends AuthController
|
||||
$cha[$k]['type'] = '已删除';
|
||||
}
|
||||
foreach ($fileAll as $k => $v) {
|
||||
$cha[$k]['filename'] = $v['filename'];
|
||||
$cha[$k]['filename'] = str_replace($rootPath,'',$v['filename']);
|
||||
$cha[$k]['cthash'] = $v['cthash'];
|
||||
$cha[$k]['atime'] = $v['atime'];
|
||||
$cha[$k]['mtime'] = $v['mtime'];
|
||||
|
||||
@ -33,7 +33,7 @@ class SystemStore extends AuthController
|
||||
* */
|
||||
public function select_address()
|
||||
{
|
||||
$key = SystemConfigService::get('tengxun_map_key');
|
||||
$key = sysConfig('tengxun_map_key');
|
||||
if(!$key) return $this->failed('请前往设置->系统设置->物流配置 配置腾讯地图KEY','#');
|
||||
$this->assign(compact('key'));
|
||||
return $this->fetch();
|
||||
@ -59,7 +59,7 @@ class SystemStore extends AuthController
|
||||
SystemStoreModel::beginTrans();
|
||||
try{
|
||||
$data['address'] = implode(',',$data['address']);
|
||||
$data['latlng'] = explode(',',$data['latlng']);
|
||||
$data['latlng'] = is_string($data['latlng']) ? explode(',',$data['latlng']) : $data['latlng'];
|
||||
if(!isset($data['latlng'][0]) || !isset($data['latlng'][1])) return JsonService::fail('请选择门店位置');
|
||||
$data['latitude'] = $data['latlng'][0];
|
||||
$data['longitude'] = $data['latlng'][1];
|
||||
|
||||
@ -36,8 +36,8 @@ class UserLevel extends AuthController
|
||||
if($id) $vipinfo=SystemUserLevel::get($id);
|
||||
$field[]= Form::input('name','等级名称',isset($vipinfo) ? $vipinfo->name : '')->col(Form::col(24));
|
||||
$field[]= Form::radio('is_forever','是否为永久',isset($vipinfo) ? $vipinfo->is_forever : 0)->options([['label'=>'永久','value'=>1],['label'=>'非永久','value'=>0]])->col(24);
|
||||
$field[]= Form::number('money','等级价格',isset($vipinfo) ? $vipinfo->money : 0)->min(0)->col(24);
|
||||
$field[]= Form::radio('is_pay','是否需要购买',isset($vipinfo) ? $vipinfo->is_pay : 0)->options([['label'=>'需要','value'=>1],['label'=>'免费','value'=>0]])->col(24);
|
||||
//$field[]= Form::number('money','等级价格',isset($vipinfo) ? $vipinfo->money : 0)->min(0)->col(24);
|
||||
//$field[]= Form::radio('is_pay','是否需要购买',isset($vipinfo) ? $vipinfo->is_pay : 0)->options([['label'=>'需要','value'=>1],['label'=>'免费','value'=>0]])->col(24);
|
||||
$field[]= Form::number('valid_date','有效时间(天)',isset($vipinfo) ? $vipinfo->valid_date : 0)->min(0)->col(8);
|
||||
$field[]= Form::number('grade','等级',isset($vipinfo) ? $vipinfo->grade : 0)->min(0)->col(8);
|
||||
$field[]= Form::number('discount','享受折扣',isset($vipinfo) ? $vipinfo->discount : 0)->min(0)->col(8);
|
||||
|
||||
@ -159,7 +159,7 @@ class WechatUser extends AuthController
|
||||
$list=[];
|
||||
if($refresh == 1) {
|
||||
UserModel::clearUserTag();
|
||||
$this->redirect(Url::buildUrl('tag'));
|
||||
$this->redirect(Url::buildUrl('tag')->suffix(false)->build());
|
||||
}
|
||||
try{
|
||||
$list = UserModel::getUserTag();
|
||||
@ -252,7 +252,7 @@ class WechatUser extends AuthController
|
||||
try{
|
||||
if($refresh == 1) {
|
||||
UserModel::clearUserGroup();
|
||||
$this->redirect(Url::buildUrl('group'));
|
||||
$this->redirect(Url::buildUrl('group')->suffix(false)->build());
|
||||
}
|
||||
$list = UserModel::getUserGroup();
|
||||
}catch (\Exception $e){}
|
||||
|
||||
@ -70,7 +70,7 @@ class Images extends AuthController
|
||||
$pid = input('pid')!= NULL ?input('pid'):session('pid');
|
||||
$upload_type = $this->request->get('upload_type',0);
|
||||
try{
|
||||
$path = make_path('attach');
|
||||
$path = make_path('attach',2,true);
|
||||
$res = Upload::getInstance()->setUploadPath($path)->setAutoValidate(true)
|
||||
->setUploadType($upload_type)->image('file');
|
||||
if(is_object($res) && $res->status === false){
|
||||
|
||||
@ -52,7 +52,7 @@ class Article extends BaseModel {
|
||||
$model = $model->where('mer_id','>',0);
|
||||
else
|
||||
$model = $model->where('mer_id',0);
|
||||
$model = $model->where('status',1)->where('hide',0);
|
||||
$model = $model->where('status',1)->where('hide',0)->order('id desc');
|
||||
return self::page($model,function($item){
|
||||
if(!$item['mer_id']) $item['admin_name'] = '总后台管理员---》'.SystemAdmin::where('id',$item['admin_id'])->value('real_name');
|
||||
else $item['admin_name'] = Merchant::where('id',$item['mer_id'])->value('mer_name').'---》'.MerchantAdmin::where('id',$item['admin_id'])->value('real_name');
|
||||
|
||||
@ -231,8 +231,8 @@ class FinanceModel extends BaseModel
|
||||
{
|
||||
$trans = self::alias('a')
|
||||
->join('user b', 'a.uid=b.uid')
|
||||
->join('__store_order_cart_info__ c', 'a.id=c.oid')
|
||||
->join('__store_product__ d', 'c.product_id=d.id')
|
||||
->join('store_order_cart_info c', 'a.id=c.oid')
|
||||
->join('store_product d', 'c.product_id=d.id')
|
||||
->field('b.nickname,a.pay_price,d.store_name')
|
||||
->order('a.add_time DESC')
|
||||
->limit('6')
|
||||
|
||||
@ -86,6 +86,7 @@ class StoreOrder extends BaseModel
|
||||
$item['_info'] = $_info;
|
||||
$item['spread_nickname'] = Db::name('user')->where('uid',$item['spread_uid'])->value('nickname');
|
||||
$item['add_time'] = date('Y-m-d H:i:s',$item['add_time']);
|
||||
$item['back_integral'] = $item['back_integral'] ? : 0;
|
||||
if($item['pink_id'] || $item['combination_id']){
|
||||
$pinkStatus = StorePink::where('order_id_key',$item['id'])->value('status');
|
||||
switch ($pinkStatus){
|
||||
@ -172,14 +173,25 @@ class StoreOrder extends BaseModel
|
||||
$img .='<img style="height:50px;" src="'.$itemImg.'" />';
|
||||
}
|
||||
}
|
||||
if(!strlen(trim($img))) $img = '无';
|
||||
$item['status_name']=<<<HTML
|
||||
if (!strlen(trim($img))) $img = '无';
|
||||
if (isset($where['excel']) && $where['excel'] == 1) {
|
||||
$refundImageStr = implode(',',$refundReasonWapImg);
|
||||
$item['status_name'] = <<<TEXT
|
||||
退款原因:{$item['refund_reason_wap']}
|
||||
备注说明:{$item['refund_reason_wap_explain']}
|
||||
退款时间:{$refundReasonTime}
|
||||
凭证连接:{$refundImageStr}
|
||||
TEXT;
|
||||
unset($refundImageStr);
|
||||
}else {
|
||||
$item['status_name'] = <<<HTML
|
||||
<b style="color:#f124c7">申请退款</b><br/>
|
||||
<span>退款原因:{$item['refund_reason_wap']}</span><br/>
|
||||
<span>备注说明:{$item['refund_reason_wap_explain']}</span><br/>
|
||||
<span>退款时间:{$refundReasonTime}</span><br/>
|
||||
<span>退款凭证:{$img}</span>
|
||||
HTML;
|
||||
}
|
||||
}else if($item['paid']==1 && $item['refund_status']==2){
|
||||
$item['status_name']='已退款';
|
||||
}
|
||||
@ -241,7 +253,7 @@ HTML;
|
||||
$item['pay_postage'],
|
||||
$item['coupon_price'],
|
||||
$item['pay_type_name'],
|
||||
$item['pay_time'] > 0 ? date('Y/md H:i',$item['pay_time']) : '暂无',
|
||||
$item['pay_time'] > 0 ? date('Y/m-d H:i',$item['pay_time']) : '暂无',
|
||||
$item['status_name'],
|
||||
$item['add_time'],
|
||||
$item['mark']
|
||||
@ -1071,7 +1083,7 @@ HTML;
|
||||
];
|
||||
if($postageData['delivery_type'] == 'send'){//送货
|
||||
$goodsName = StoreOrderCartInfo::getProductNameList($order['id']);
|
||||
if($order['is_channel']){
|
||||
if($order['is_channel'] == 1){
|
||||
//小程序送货模版消息
|
||||
RoutineTemplate::sendOrderPostage($order);
|
||||
}else{//公众号
|
||||
@ -1086,7 +1098,7 @@ HTML;
|
||||
WechatTemplateService::sendTemplate($openid,WechatTemplateService::ORDER_DELIVER_SUCCESS,$group,$url);
|
||||
}
|
||||
}else if($postageData['delivery_type'] == 'express') {//发货
|
||||
if ($order['is_channel']) {
|
||||
if ($order['is_channel'] == 1) {
|
||||
//小程序发货模版消息
|
||||
RoutineTemplate::sendOrderPostage($order,1);
|
||||
} else {//公众号
|
||||
@ -1123,7 +1135,7 @@ HTML;
|
||||
$title = StoreProduct::where('id',$cartInfo['product_id'])->value('store_name');
|
||||
}
|
||||
|
||||
if($order['is_channel']){//小程序
|
||||
if($order['is_channel'] == 1){//小程序
|
||||
RoutineTemplate::sendOut('OREDER_TAKEVER',$order['uid'],[
|
||||
'keyword1'=>$order['order_id'],
|
||||
'keyword2'=>$title,
|
||||
@ -1159,7 +1171,7 @@ HTML;
|
||||
$store_name = StoreProduct::where('id',$productId)->value('store_name');
|
||||
$title.=$store_name.',';
|
||||
}
|
||||
if($order->is_channel){
|
||||
if($order->is_channel == 1){
|
||||
RoutineTemplate::sendOut('ORDER_REFUND_FILE',$order->uid,[
|
||||
'keyword1'=>$order->order_id,
|
||||
'keyword2'=>$title,
|
||||
@ -1173,7 +1185,7 @@ HTML;
|
||||
'keyword2'=>$order->pay_price,
|
||||
'keyword3'=>date('Y-m-d H:i:s',time()),
|
||||
'remark'=>'给您带来的不便,请谅解!'
|
||||
]);
|
||||
],Url::buildUrl('/order/detail/'.$order['order_id'])->suffix('')->domain(true)->build());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -130,7 +130,7 @@ class StoreStatistics extends BaseModel
|
||||
*/
|
||||
public static function getConsumption($where)
|
||||
{
|
||||
$consumption=self::getTime($where,new UserBill,'b.add_time')->alias('a')->join('__user__ b','a.uid = b.uid')
|
||||
$consumption=self::getTime($where,new UserBill,'b.add_time')->alias('a')->join('user b','a.uid = b.uid')
|
||||
->field('sum(a.number) number')
|
||||
->where('a.type','pay_product')->find()->toArray();
|
||||
return $consumption;
|
||||
@ -182,9 +182,9 @@ class StoreStatistics extends BaseModel
|
||||
public static function trans()
|
||||
{
|
||||
$trans = self::alias('a')
|
||||
->join('__user__ b', 'a.uid=b.uid','left')
|
||||
->join('__store_order_cart_info__ c', 'a.id=c.oid')
|
||||
->join('__store_product__ d', 'c.product_id=d.id')
|
||||
->join('user b', 'a.uid=b.uid','left')
|
||||
->join('store_order_cart_info c', 'a.id=c.oid')
|
||||
->join('store_product d', 'c.product_id=d.id')
|
||||
->field('b.nickname,a.pay_price,d.store_name')
|
||||
->order('a.add_time DESC')
|
||||
->limit('6')
|
||||
|
||||
@ -80,9 +80,7 @@ class StoreProduct extends BaseModel
|
||||
$data = ['p.is_show'=>1,'p.is_del'=>0,'pav.stock|p.stock'=>0];
|
||||
break;
|
||||
case 5:
|
||||
$min = SystemConfig::getConfigValue('store_stock');
|
||||
$min = $min ? $min : 10;
|
||||
$data = ['p.is_show'=>1,'p.is_del'=>0,'pav.stock|p.stock'=>['<=',$min]];
|
||||
$data = ['p.is_show'=>1,'p.is_del'=>0];
|
||||
break;
|
||||
case 6:
|
||||
$data = ['p.is_del'=>1];
|
||||
@ -101,7 +99,13 @@ class StoreProduct extends BaseModel
|
||||
if(!empty($where)){
|
||||
$model=$model->group('p.id');
|
||||
if(isset($where['type']) && $where['type']!='' && ($data=self::setData($where['type']))){
|
||||
$model = $model->where($data);
|
||||
if ($where['type'] == 5) {
|
||||
$store_stock = sysConfig('store_stock');
|
||||
if($store_stock < 0) $store_stock = 2;
|
||||
$model = $model->where($data)->where('p.stock','<=',$store_stock);
|
||||
} else {
|
||||
$model = $model->where($data);
|
||||
}
|
||||
}
|
||||
if(isset($where['store_name']) && $where['store_name']!=''){
|
||||
$model = $model->where('p.store_name|p.keyword|p.id','LIKE',"%$where[store_name]%");
|
||||
@ -117,6 +121,8 @@ class StoreProduct extends BaseModel
|
||||
}
|
||||
if(isset($where['order']) && $where['order']!=''){
|
||||
$model = $model->order(self::setOrder($where['order']));
|
||||
}else{
|
||||
$model = $model->order('p.sort desc,p.id desc');
|
||||
}
|
||||
}
|
||||
return $model;
|
||||
@ -359,7 +365,7 @@ class StoreProduct extends BaseModel
|
||||
*/
|
||||
public static function getMaxList($where){
|
||||
$classs=['layui-bg-red','layui-bg-orange','layui-bg-green','layui-bg-blue','layui-bg-cyan'];
|
||||
$model=StoreOrder::alias('a')->join('StoreOrderCartInfo c','a.id=c.oid')->join('__store_product__ b','b.id=c.product_id');
|
||||
$model=StoreOrder::alias('a')->join('StoreOrderCartInfo c','a.id=c.oid')->join('store_product b','b.id=c.product_id');
|
||||
$list=self::getModelTime($where,$model,'a.add_time')->group('c.product_id')->order('p_count desc')->limit(10)
|
||||
->field(['count(c.product_id) as p_count','b.store_name','sum(b.price) as sum_price'])->select();
|
||||
if(count($list)) $list=$list->toArray();
|
||||
@ -386,7 +392,7 @@ class StoreProduct extends BaseModel
|
||||
$classs=['layui-bg-red','layui-bg-orange','layui-bg-green','layui-bg-blue','layui-bg-cyan'];
|
||||
$model=StoreOrder::alias('a')
|
||||
->join('StoreOrderCartInfo c','a.id=c.oid')
|
||||
->join('__store_product__ b','b.id=c.product_id')
|
||||
->join('store_product b','b.id=c.product_id')
|
||||
->where('b.is_show',1)
|
||||
->where('b.is_del',0);
|
||||
$list=self::getModelTime($where,$model,'a.add_time')->group('c.product_id')->order('profity desc')->limit(10)
|
||||
@ -480,7 +486,7 @@ class StoreProduct extends BaseModel
|
||||
}else{
|
||||
$time['data']=isset($where['data'])? $where['data']:'';
|
||||
}
|
||||
$model=self::getModelTime($time, Db::name('store_cart')->alias('a')->join('__store_product__ b','a.product_id=b.id'),'a.add_time');
|
||||
$model=self::getModelTime($time, Db::name('store_cart')->alias('a')->join('store_product b','a.product_id=b.id'),'a.add_time');
|
||||
if(isset($where['title']) && $where['title']!=''){
|
||||
$model=$model->where('b.store_name|b.id','like',"%$where[title]%");
|
||||
}
|
||||
|
||||
@ -55,7 +55,7 @@ class StoreProductAttrValue extends BaseModel
|
||||
->dec('stock',$num)->inc('sales',$num)->update();
|
||||
if($res){
|
||||
$stock = self::where('product_id',$productId)->where('unique',$unique)->value('stock');
|
||||
$replenishment_num = SystemConfigService::get('store_stock') ?? 0;//库存预警界限
|
||||
$replenishment_num = sysConfig('store_stock') ?? 0;//库存预警界限
|
||||
if($replenishment_num >= $stock){
|
||||
try{
|
||||
ChannelService::instance()->send('STORE_STOCK', ['id'=>$productId]);
|
||||
@ -100,7 +100,7 @@ class StoreProductAttrValue extends BaseModel
|
||||
$valueNew[$count]['price'] = $sukValue[$suk]['price'];
|
||||
$valueNew[$count]['sales'] = $sukValue[$suk]['sales'];
|
||||
$valueNew[$count]['pic'] = $sukValue[$suk]['pic'];
|
||||
$valueNew[$count]['bar_code'] = $sukValue[$suk]['bar_code'];
|
||||
$valueNew[$count]['bar_code'] = $sukValue[$suk]['bar_code'] ?? '';
|
||||
$valueNew[$count]['check'] = false;
|
||||
$count++;
|
||||
}
|
||||
|
||||
@ -28,14 +28,14 @@ class StoreProductRelation extends BaseModel
|
||||
public static function getCollect($pid){
|
||||
$model = new self();
|
||||
$model = $model->where('r.product_id',$pid)->where('r.type','collect');
|
||||
$model = $model->alias('r')->join('__WECHAT_USER__ u','u.uid=r.uid');
|
||||
$model = $model->alias('r')->join('wechat_user u','u.uid=r.uid');
|
||||
$model = $model->field('r.*,u.nickname');
|
||||
return self::page($model);
|
||||
}
|
||||
public static function getLike($pid){
|
||||
$model = new self();
|
||||
$model = $model->where('r.product_id',$pid)->where('r.type','like');
|
||||
$model = $model->alias('r')->join('__WECHAT_USER__ u','u.uid=r.uid');
|
||||
$model = $model->alias('r')->join('wechat_user u','u.uid=r.uid');
|
||||
$model = $model->field('r.*,u.nickname');
|
||||
return self::page($model);
|
||||
}
|
||||
|
||||
@ -57,7 +57,7 @@ class StoreProductReply extends BaseModel
|
||||
|
||||
public static function getProductImaesList($where)
|
||||
{
|
||||
$list=self::valiWhere($where,'a','p')->group('p.id')->join('__wechat_user__ u','u.uid=a.uid')->join("__store_product__ p",'a.product_id=p.id')->field(['p.id','p.image','p.store_name','p.price'])->page($where['page'],$where['limit'])->select();
|
||||
$list=self::valiWhere($where,'a','p')->group('p.id')->join('wechat_user u','u.uid=a.uid','LEFT')->join("store_product p",'a.product_id=p.id','LEFT')->field(['p.id','p.image','p.store_name','p.price'])->page($where['page'],$where['limit'])->select();
|
||||
$list=count($list) ? $list->toArray() : [];
|
||||
foreach ($list as &$item){
|
||||
$item['store_name']=self::getSubstrUTf8($item['store_name'],10,'UTF-8','');
|
||||
@ -68,17 +68,18 @@ class StoreProductReply extends BaseModel
|
||||
|
||||
public static function getProductReplyList($where)
|
||||
{
|
||||
$data=self::valiWhere($where,'a','p')->join("__store_product__ p",'a.product_id=p.id')
|
||||
->join('__wechat_user__ u','u.uid=a.uid')
|
||||
$data=self::valiWhere($where,'a','p')->join("store_product p",'a.product_id=p.id','left')
|
||||
->join('user u','u.uid=a.uid','left')
|
||||
->order('a.add_time desc,a.is_reply asc')
|
||||
->field('a.*,u.nickname,u.headimgurl as avatar')
|
||||
->field('a.*,u.nickname,u.avatar')
|
||||
->page((int)$where['message_page'],(int)$where['limit'])
|
||||
->select();
|
||||
$data=count($data) ? $data->toArray() : [];
|
||||
foreach ($data as &$item){
|
||||
$item['time']=\crmeb\services\UtilService::timeTran($item['add_time']);
|
||||
}
|
||||
$count=self::valiWhere($where,'a','p')->join('__wechat_user__ u','u.uid=a.uid')->join("__store_product__ p",'a.product_id=p.id')->count();
|
||||
|
||||
$count=self::valiWhere($where,'a','p')->join('user u','u.uid=a.uid','left')->join("store_product p",'a.product_id=p.id','left')->count();
|
||||
return ['list'=>$data,'count'=>$count];
|
||||
}
|
||||
/**
|
||||
@ -96,8 +97,8 @@ class StoreProductReply extends BaseModel
|
||||
}
|
||||
}
|
||||
if($where['product_id']) $model = $model->where('r.product_id',$where['product_id']);
|
||||
$model = $model->alias('r')->join('__wechat_user__ u','u.uid=r.uid');
|
||||
$model = $model->join('__store_product__ p','p.id=r.product_id');
|
||||
$model = $model->alias('r')->join('wechat_user u','u.uid=r.uid');
|
||||
$model = $model->join('store_product p','p.id=r.product_id');
|
||||
$model = $model->where('r.is_del',0);
|
||||
$model = $model->field('r.*,u.nickname,u.headimgurl,p.store_name');
|
||||
$model = $model->order('r.add_time desc,r.is_reply asc');
|
||||
|
||||
@ -117,10 +117,9 @@ class SystemAttachment extends BaseModel
|
||||
*/
|
||||
public static function emptyYesterdayAttachment()
|
||||
{
|
||||
self::beginTrans();
|
||||
try{
|
||||
$list = self::whereTime('time','yesterday')->where(['module_type'=>2])->column('att_dir','att_id');
|
||||
foreach ($list as $att_id => $att_dir){
|
||||
$list = self::whereTime('time','yesterday')->where(['module_type'=>2])->column('att_dir','att_id');
|
||||
foreach ($list as $att_id => $att_dir){
|
||||
try{
|
||||
if($att_dir && strstr($att_dir,'uploads') !== false){
|
||||
if(strstr($att_dir,'http') === false)
|
||||
@unlink(substr($att_dir,1));
|
||||
@ -129,11 +128,8 @@ class SystemAttachment extends BaseModel
|
||||
@unlink($filedir);
|
||||
}
|
||||
}
|
||||
self::del($att_id);
|
||||
}
|
||||
self::commitTrans();
|
||||
}catch (\Exception $e){
|
||||
self::rollbackTrans();
|
||||
}catch (\Throwable $e){}
|
||||
self::del($att_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -193,9 +193,9 @@ class SystemConfig extends BaseModel
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @throws \think\exception\DbException
|
||||
*/
|
||||
public static function getAll($id){
|
||||
public static function getAll($id,int $status = 1){
|
||||
$where['config_tab_id'] = $id;
|
||||
$where['status'] = 1;
|
||||
if($status == 1) $where['status'] = $status;
|
||||
return self::where($where)->order('sort desc,id asc')->select();
|
||||
}
|
||||
|
||||
|
||||
@ -50,14 +50,14 @@ class SystemLog extends BaseModel
|
||||
public static function adminVisit($adminId,$adminName,$type)
|
||||
{
|
||||
$request = app('request');
|
||||
$module = $request->app();
|
||||
$module = app('http')->getName();
|
||||
$controller = $request->controller();
|
||||
$action = $request->action();
|
||||
$route = $request->route();
|
||||
self::startTrans();
|
||||
try{
|
||||
$data = [
|
||||
'method'=>$request->app(),
|
||||
'method'=>app('http')->getName(),
|
||||
'admin_id'=>$adminId,
|
||||
'add_time'=>time(),
|
||||
'admin_name'=>$adminName,
|
||||
@ -90,7 +90,7 @@ class SystemLog extends BaseModel
|
||||
public static function setCurrentVisit($adminInfo, $page)
|
||||
{
|
||||
$request = app('request');
|
||||
$module = $request->app();
|
||||
$module = app('http')->getName();
|
||||
$controller = $request->controller();
|
||||
$action = $request->action();
|
||||
$route = $request->route();
|
||||
|
||||
@ -103,7 +103,7 @@ class SystemNotice extends BaseModel
|
||||
|
||||
public static function getAdminNoticeTotal($adminId)
|
||||
{
|
||||
$list = self::alias('A')->join('__SYSTEM_NOTICE_ADMIN__ B','B.notice_type = A.type')
|
||||
$list = self::alias('A')->join('system_notice_admin B','B.notice_type = A.type')
|
||||
->where('A.status',1)->where('B.is_visit',0)->where('B.is_click',0)->where('B.admin_id',$adminId)
|
||||
->field('count(B.id) total')->group('A.id')->select()->toArray();
|
||||
if(!$list) return 0;
|
||||
@ -114,7 +114,7 @@ class SystemNotice extends BaseModel
|
||||
|
||||
public static function getAdminNotice($adminId)
|
||||
{
|
||||
$list = self::alias('A')->join('__SYSTEM_NOTICE_ADMIN__ B','B.notice_type = A.type')
|
||||
$list = self::alias('A')->join('system_notice_admin B','B.notice_type = A.type')
|
||||
->where('A.status',1)->where('B.is_visit',0)->where('B.is_click',0)->where('B.admin_id',$adminId)
|
||||
->field('A.id,A.type,A.title,A.icon,count(B.id) total,A.template,max(B.add_time) as last_time')
|
||||
->group('A.id')->having('total > 0')->select()->toArray();
|
||||
|
||||
@ -174,7 +174,7 @@ class StoreBargain extends BaseModel
|
||||
*/
|
||||
public static function getMaxList($where){
|
||||
$classs=['layui-bg-red','layui-bg-orange','layui-bg-green','layui-bg-blue','layui-bg-cyan'];
|
||||
$model=StoreOrder::alias('a')->join('__store_bargain__ b','b.id=a.bargain_id')->where('a.paid',1);
|
||||
$model=StoreOrder::alias('a')->join('store_bargain b','b.id=a.bargain_id')->where('a.paid',1);
|
||||
$list=self::getModelTime($where,$model,'a.add_time')->group('a.bargain_id')->order('p_count desc')->limit(10)
|
||||
->field(['count(a.bargain_id) as p_count','b.title as store_name','sum(b.price) as sum_price'])->select();
|
||||
if(count($list)) $list=$list->toArray();
|
||||
@ -204,7 +204,7 @@ class StoreBargain extends BaseModel
|
||||
*/
|
||||
public static function ProfityTop10($where){
|
||||
$classs=['layui-bg-red','layui-bg-orange','layui-bg-green','layui-bg-blue','layui-bg-cyan'];
|
||||
$model=StoreOrder::alias('a')->join('__store_bargain__ b','b.id=a.bargain_id')->where('a.paid',1);
|
||||
$model=StoreOrder::alias('a')->join('store_bargain b','b.id=a.bargain_id')->where('a.paid',1);
|
||||
$list=self::getModelTime($where,$model,'a.add_time')->group('a.bargain_id')->order('profity desc')->limit(10)
|
||||
->field(['count(a.bargain_id) as p_count','b.title as store_name','sum(b.price) as sum_price','(b.price-b.cost) as profity'])
|
||||
->select();
|
||||
@ -257,7 +257,7 @@ class StoreBargain extends BaseModel
|
||||
* @return mixed
|
||||
*/
|
||||
public static function getBargainRefundList($where = array()){
|
||||
$model = StoreOrder::alias('a')->join('__store_bargain__ b','b.id=a.bargain_id');
|
||||
$model = StoreOrder::alias('a')->join('store_bargain b','b.id=a.bargain_id');
|
||||
$list = self::getModelTime($where,$model,'a.add_time')->where('a.refund_status','<>',0)->group('a.bargain_id')->order('count desc')->page((int)$where['page'],(int)$where['limit'])
|
||||
->field(['count(a.bargain_id) as count','b.title as store_name','sum(b.price) as sum_price'])->select();
|
||||
if(count($list)) $list=$list->toArray();
|
||||
|
||||
@ -386,7 +386,7 @@ class StoreCombination extends BaseModel
|
||||
*/
|
||||
public static function ProfityTop10($where){
|
||||
$classs=['layui-bg-red','layui-bg-orange','layui-bg-green','layui-bg-blue','layui-bg-cyan'];
|
||||
$model = StoreOrder::alias('a')->join('__store_combination__ b','b.id = a.combination_id')->where('a.paid',1);
|
||||
$model = StoreOrder::alias('a')->join('store_combination b','b.id = a.combination_id')->where('a.paid',1);
|
||||
$list=self::getModelTime($where,$model,'a.add_time')->group('a.seckill_id')->order('profity desc')->limit(10)
|
||||
->field('count(a.combination_id) as p_count,b.title as store_name,sum(b.price) as sum_price,(b.price-b.cost) as profity')
|
||||
->select();
|
||||
@ -410,7 +410,7 @@ class StoreCombination extends BaseModel
|
||||
}
|
||||
public static function getMaxList($where){
|
||||
$classs=['layui-bg-red','layui-bg-orange','layui-bg-green','layui-bg-blue','layui-bg-cyan'];
|
||||
$model=StoreOrder::alias('a')->join('__store_combination__ b','b.id=a.combination_id')->where('a.paid',1);
|
||||
$model=StoreOrder::alias('a')->join('store_combination b','b.id=a.combination_id')->where('a.paid',1);
|
||||
$list=self::getModelTime($where,$model,'a.add_time')->group('a.combination_id')->order('p_count desc')->limit(10)
|
||||
->field('count(a.combination_id) as p_count,b.title as store_name,sum(b.price) as sum_price')->select();
|
||||
if(count($list)) $list=$list->toArray();
|
||||
@ -438,7 +438,7 @@ class StoreCombination extends BaseModel
|
||||
* @return mixed
|
||||
*/
|
||||
public static function getBargainRefundList($where = array()){
|
||||
$model = StoreOrder::alias('a')->join('__store_combination__ b','b.id=a.combination_id');
|
||||
$model = StoreOrder::alias('a')->join('store_combination b','b.id=a.combination_id');
|
||||
$list = self::getModelTime($where,$model,'a.add_time')->where('a.refund_status','<>',0)->group('a.combination_id')
|
||||
->order('count desc')->page((int)$where['page'],(int)$where['limit'])
|
||||
->field('count(a.combination_id) as count,b.title as store_name,sum(b.price) as sum_price')
|
||||
|
||||
@ -28,7 +28,7 @@ class StoreCouponIssue extends BaseModel
|
||||
protected $insert = ['add_time'];
|
||||
|
||||
public static function stsypage($where){
|
||||
$model = self::alias('A')->field('A.*,B.title')->join('__store_coupon__ B','A.cid = B.id')->where('A.is_del',0)->order('A.add_time DESC');
|
||||
$model = self::alias('A')->field('A.*,B.title')->join('store_coupon B','A.cid = B.id')->where('A.is_del',0)->order('A.add_time DESC');
|
||||
if(isset($where['status']) && $where['status']!=''){
|
||||
$model=$model->where('A.status',$where['status']);
|
||||
}
|
||||
|
||||
@ -22,7 +22,7 @@ class StoreCouponIssueUser extends BaseModel
|
||||
public static function systemCouponIssuePage($issue_coupon_id)
|
||||
{
|
||||
$model = self::alias('A')->field('B.nickname,B.avatar,A.add_time')
|
||||
->join('__user__ B','A.uid = B.uid')
|
||||
->join('user B','A.uid = B.uid')
|
||||
->where('A.issue_coupon_id',$issue_coupon_id);
|
||||
return self::page($model,function($item){
|
||||
$item['add_time'] = $item['add_time'] == 0 ? '未知' : date('Y/m/d H:i',$item['add_time']);
|
||||
|
||||
@ -37,8 +37,8 @@ class StorePink extends BaseModel
|
||||
if($where['status']) $model = $model->where('p.status',$where['status']);
|
||||
$model = $model->where('p.k_id',0);
|
||||
$model = $model->order('p.id desc');
|
||||
$model = $model->join('__store_combination__ c','c.id=p.cid');
|
||||
$model = $model->join('__user__ u','u.uid = p.uid');
|
||||
$model = $model->join('store_combination c','c.id=p.cid');
|
||||
$model = $model->join('user u','u.uid = p.uid');
|
||||
return self::page($model,function($item)use($where){
|
||||
$item['count_people'] = bcadd(self::where('k_id',$item['id'])->count(),1,0);
|
||||
},$where);
|
||||
@ -72,7 +72,7 @@ class StorePink extends BaseModel
|
||||
$model = $model->alias('p');
|
||||
$model = $model->field('p.*,u.nickname,u.avatar');
|
||||
$model = $model->where('id',$id);
|
||||
$model = $model->join('__user__ u','u.uid = p.uid');
|
||||
$model = $model->join('user u','u.uid = p.uid');
|
||||
$list = $model->find();
|
||||
if($list) return $list->toArray();
|
||||
else return [];
|
||||
@ -88,7 +88,7 @@ class StorePink extends BaseModel
|
||||
$model = $model->field('p.*,u.nickname,u.avatar');
|
||||
$model = $model->where('k_id',$id);
|
||||
$model = $model->where('is_refund',0);
|
||||
$model = $model->join('__user__ u','u.uid = p.uid');
|
||||
$model = $model->join('user u','u.uid = p.uid');
|
||||
$model = $model->order('id asc');
|
||||
$list = $model->select();
|
||||
if($list) return $list->toArray();
|
||||
|
||||
@ -172,7 +172,7 @@ class StoreSeckill extends BaseModel
|
||||
*/
|
||||
public static function getMaxList($where){
|
||||
$classs=['layui-bg-red','layui-bg-orange','layui-bg-green','layui-bg-blue','layui-bg-cyan'];
|
||||
$model=StoreOrder::alias('a')->join('__store_seckill__ b','b.id=a.seckill_id')->where('a.paid',1);
|
||||
$model=StoreOrder::alias('a')->join('store_seckill b','b.id=a.seckill_id')->where('a.paid',1);
|
||||
$list=self::getModelTime($where,$model,'a.add_time')->group('a.seckill_id')->order('p_count desc')->limit(10)
|
||||
->field(['count(a.seckill_id) as p_count','b.title as store_name','sum(b.price) as sum_price'])->select();
|
||||
if(count($list)) $list=$list->toArray();
|
||||
@ -202,7 +202,7 @@ class StoreSeckill extends BaseModel
|
||||
*/
|
||||
public static function ProfityTop10($where){
|
||||
$classs=['layui-bg-red','layui-bg-orange','layui-bg-green','layui-bg-blue','layui-bg-cyan'];
|
||||
$model = StoreOrder::alias('a')->join('__store_seckill__ b','b.id = a.seckill_id')->where('a.paid',1);
|
||||
$model = StoreOrder::alias('a')->join('store_seckill b','b.id = a.seckill_id')->where('a.paid',1);
|
||||
$list=self::getModelTime($where,$model,'a.add_time')->group('a.seckill_id')->order('profity desc')->limit(10)
|
||||
->field(['count(a.seckill_id) as p_count','b.title as store_name','sum(b.price) as sum_price','(b.price-b.cost) as profity'])
|
||||
->select();
|
||||
@ -255,7 +255,7 @@ class StoreSeckill extends BaseModel
|
||||
* @return mixed
|
||||
*/
|
||||
public static function getBargainRefundList($where = array()){
|
||||
$model = StoreOrder::alias('a')->join('__store_seckill__ b','b.id=a.seckill_id');
|
||||
$model = StoreOrder::alias('a')->join('store_seckill b','b.id=a.seckill_id');
|
||||
$list = self::getModelTime($where,$model,'a.add_time')->where('a.refund_status','<>',0)->group('a.seckill_id')->order('count desc')->page((int)$where['page'],(int)$where['limit'])
|
||||
->field(['count(a.seckill_id) as count','b.title as store_name','sum(b.price) as sum_price'])->select();
|
||||
if(count($list)) $list=$list->toArray();
|
||||
|
||||
@ -413,7 +413,7 @@ class User extends BaseModel
|
||||
public static function getBadgeList($where){
|
||||
$user_count = self::setWherePage(self::getModelTime($where,new self),$where,['is_promoter','status'])->count();
|
||||
$user_count_old = self::getOldDate($where)->count();
|
||||
$store_brokerage_statu = SystemConfigService::get('store_brokerage_statu');
|
||||
$store_brokerage_statu = sysConfig('store_brokerage_statu');
|
||||
if($store_brokerage_statu == 1)
|
||||
$fenxiao = self::setWherePage(self::getModelTime($where,new self),$where,['is_promoter','status'])->where('spread_uid','<>',0)->count();
|
||||
else
|
||||
@ -483,7 +483,7 @@ class User extends BaseModel
|
||||
(count($xdata) > $limit) && $Zoom = $xdata[$limit-5];
|
||||
//多次购物会员数量饼状图
|
||||
$count = self::setWherePage(self::getModelTime($where,new self),$where,['is_promoter'])->count();
|
||||
$user_count = self::setWherePage(self::getModelTime($where,self::alias('a')->join('__store_order__ r','r.uid=a.uid'),'a.add_time'),$where,['is_promoter'])
|
||||
$user_count = self::setWherePage(self::getModelTime($where,self::alias('a')->join('store_order r','r.uid=a.uid'),'a.add_time'),$where,['is_promoter'])
|
||||
->where('r.paid',1)->count('a.uid');
|
||||
$shop_xdata = ['多次购买数量占比','无购买数量占比'];
|
||||
$shop_data = [];
|
||||
@ -724,7 +724,7 @@ class User extends BaseModel
|
||||
*/
|
||||
public static function getUserBusinessChart($where,$limit=20){
|
||||
//获取购物会员人数趋势图
|
||||
$list=self::getModelTime($where,self::where('a.status',1)->alias('a')->join('__store_order__ r','r.uid=a.uid'),'a.add_time')
|
||||
$list=self::getModelTime($where,self::where('a.status',1)->alias('a')->join('store_order r','r.uid=a.uid'),'a.add_time')
|
||||
->where('r.paid', 1)
|
||||
->where('a.is_promoter', 0)
|
||||
->where('a.add_time','<>',0)
|
||||
@ -742,7 +742,7 @@ class User extends BaseModel
|
||||
}
|
||||
count($xdata) > $limit && $zoom=$xdata[$limit-5];
|
||||
//会员访问量
|
||||
$visit=self::getModelTime($where,self::alias('a')->join('__store_visit__ t','t.uid=a.uid'),'t.add_time')
|
||||
$visit=self::getModelTime($where,self::alias('a')->join('store_visit t','t.uid=a.uid'),'t.add_time')
|
||||
->where('a.is_promoter',0)
|
||||
->field('FROM_UNIXTIME(t.add_time,"%Y-%m-%d") as _add_time,count(t.uid) as count_user')
|
||||
->group('_add_time')
|
||||
@ -759,7 +759,7 @@ class User extends BaseModel
|
||||
count($visit_xdata) > $limit && $visit_zoom=$visit_xdata[$limit-5];
|
||||
//多次购物会员数量饼状图
|
||||
$count=self::getModelTime($where,self::where('is_promoter',0))->count();
|
||||
$user_count=self::getModelTime($where,self::alias('a')->join('__store_order__ r','r.uid=a.uid'),'a.add_time')
|
||||
$user_count=self::getModelTime($where,self::alias('a')->join('store_order r','r.uid=a.uid'),'a.add_time')
|
||||
->where('a.is_promoter',0)
|
||||
->where('r.paid',1)
|
||||
->group('a.uid')
|
||||
@ -817,7 +817,7 @@ class User extends BaseModel
|
||||
$orderPayCount = StoreOrder::getOrderPayCount($is_promoter);
|
||||
if($orderPayCount){
|
||||
$shopcount=self::alias('a')
|
||||
->join('__store_order__ r','r.uid=a.uid')
|
||||
->join('store_order r','r.uid=a.uid')
|
||||
->where('r.paid', 1)
|
||||
->where('a.is_promoter', $is_promoter)
|
||||
->group('r.uid')
|
||||
@ -830,7 +830,7 @@ class User extends BaseModel
|
||||
//购物金额排行榜
|
||||
if($orderPayCount){
|
||||
$order=self::alias('a')
|
||||
->join('__store_order__ r','r.uid=a.uid')
|
||||
->join('store_order r','r.uid=a.uid')
|
||||
->where('r.paid', 1)
|
||||
->where('a.is_promoter', $is_promoter)
|
||||
->group('r.uid')
|
||||
@ -844,7 +844,7 @@ class User extends BaseModel
|
||||
$orderPayCount = StoreOrder::getOrderPayMonthCount($is_promoter);
|
||||
if($orderPayCount){
|
||||
$lastorder=self::alias('a')
|
||||
->join('__store_order__ r','r.uid=a.uid')
|
||||
->join('store_order r','r.uid=a.uid')
|
||||
->where('r.paid', 1)
|
||||
->where('a.is_promoter', $is_promoter)
|
||||
// ->whereTime('r.pay_time','last month')
|
||||
@ -1014,7 +1014,7 @@ class User extends BaseModel
|
||||
}
|
||||
count($visit_xdata) > $limit && $visit_zoom=$visit_xdata[$limit-5];
|
||||
//获取购物会员人数趋势图
|
||||
$list=self::getModelTime($where,self::where('a.status',1)->alias('a')->join('__store_order__ r','r.uid=a.uid'),'a.add_time')
|
||||
$list=self::getModelTime($where,self::where('a.status',1)->alias('a')->join('store_order r','r.uid=a.uid'),'a.add_time')
|
||||
->where('r.paid', 1)
|
||||
->where('a.is_promoter', 1)
|
||||
->where('a.add_time','<>',0)
|
||||
@ -1034,7 +1034,7 @@ class User extends BaseModel
|
||||
//多次购物分销会员数量饼状图
|
||||
$count=self::getModelTime($where,self::where('is_promoter',1))->count();
|
||||
$user_count=self::getModelTime($where,self::alias('a')
|
||||
->join('__store_order__ r','r.uid=a.uid'),'a.add_time')
|
||||
->join('store_order r','r.uid=a.uid'),'a.add_time')
|
||||
->where('a.is_promoter',1)
|
||||
->where('r.paid',1)
|
||||
->group('a.uid')
|
||||
@ -1110,11 +1110,11 @@ class User extends BaseModel
|
||||
{
|
||||
$userInfo = User::getUserInfo($orderInfo['uid']);
|
||||
if(!$userInfo || !$userInfo['spread_uid']) return true;
|
||||
$storeBrokerageStatu = SystemConfigService::get('store_brokerage_statu') ? : 1;//获取后台分销类型
|
||||
$storeBrokerageStatu = sysConfig('store_brokerage_statu') ? : 1;//获取后台分销类型
|
||||
if($storeBrokerageStatu == 1){
|
||||
if(!User::be(['uid'=>$userInfo['spread_uid'],'is_promoter'=>1])) return true;
|
||||
}
|
||||
$brokerageRatio = (SystemConfigService::get('store_brokerage_ratio') ?: 0)/100;
|
||||
$brokerageRatio = (sysConfig('store_brokerage_ratio') ?: 0)/100;
|
||||
if($brokerageRatio <= 0) return true;
|
||||
$cost = isset($orderInfo['cost']) ? $orderInfo['cost'] : 0;//成本价
|
||||
if($cost > $orderInfo['pay_price']) return true;//成本价大于支付价格时直接返回
|
||||
@ -1142,11 +1142,11 @@ class User extends BaseModel
|
||||
$userInfo = User::getUserInfo($orderInfo['uid']);
|
||||
$userInfoTwo = User::getUserInfo($userInfo['spread_uid']);
|
||||
if(!$userInfoTwo || !$userInfoTwo['spread_uid']) return true;
|
||||
$storeBrokerageStatu = SystemConfigService::get('store_brokerage_statu') ? : 1;//获取后台分销类型
|
||||
$storeBrokerageStatu = sysConfig('store_brokerage_statu') ? : 1;//获取后台分销类型
|
||||
if($storeBrokerageStatu == 1){
|
||||
if(!User::be(['uid'=>$userInfoTwo['spread_uid'],'is_promoter'=>1])) return true;
|
||||
}
|
||||
$brokerageRatio = (SystemConfigService::get('store_brokerage_two') ?: 0)/100;
|
||||
$brokerageRatio = (sysConfig('store_brokerage_two') ?: 0)/100;
|
||||
if($brokerageRatio <= 0) return true;
|
||||
$cost = isset($orderInfo['cost']) ? $orderInfo['cost'] : 0;//成本价
|
||||
if($cost > $orderInfo['pay_price']) return true;//成本价大于支付价格时直接返回
|
||||
|
||||
@ -130,7 +130,7 @@ class UserBill extends BaseModel
|
||||
->where('a.type', 'brokerage')
|
||||
->where('a.pm', 1)
|
||||
->order('a.number desc')
|
||||
->join('__store_order__ o','o.id=a.link_id')
|
||||
->join('store_order o','o.id=a.link_id')
|
||||
->field('o.order_id,FROM_UNIXTIME(a.add_time,"%Y-%c-%d") as add_time,a.uid,o.uid as down_uid,r.nickname,r.avatar,r.spread_uid,r.level,a.number')
|
||||
->page((int)$where['page'],(int)$where['limit'])
|
||||
->select();
|
||||
@ -139,7 +139,7 @@ class UserBill extends BaseModel
|
||||
}
|
||||
//获取返佣用户总人数
|
||||
public static function getFanCount(){
|
||||
return self::alias('a')->join('user r','a.uid=r.uid')->join('__store_order__ o','o.id=a.link_id')->where('a.category','now_money')->where('a.type', 'brokerage')->where('a.pm', 1)->count();
|
||||
return self::alias('a')->join('user r','a.uid=r.uid')->join('store_order o','o.id=a.link_id')->where('a.category','now_money')->where('a.type', 'brokerage')->where('a.pm', 1)->count();
|
||||
}
|
||||
//获取用户充值数据
|
||||
public static function getEchartsRecharge($where,$limit=15){
|
||||
|
||||
@ -75,7 +75,7 @@ class UserExtract extends BaseModel
|
||||
if($where['nireid'] != '') $model = $model->where('a.real_name|a.id|b.nickname|a.bank_code|a.alipay_code','like',"%$where[nireid]%");
|
||||
$model = $model->alias('a');
|
||||
$model = $model->field('a.*,b.nickname');
|
||||
$model = $model->join('__user__ b','b.uid=a.uid','LEFT');
|
||||
$model = $model->join('user b','b.uid=a.uid','LEFT');
|
||||
$model = $model->order('a.id desc');
|
||||
return self::page($model, $where);
|
||||
}
|
||||
@ -325,7 +325,7 @@ class UserExtract extends BaseModel
|
||||
*/
|
||||
public static function getUserCountPrice($uid = 0){
|
||||
if(!$uid) return 0;
|
||||
$price = self::where('uid',$uid)->where('status',1)->field('sum(extract_price) as price')->find()['price'];
|
||||
$price = self::where('uid',$uid)->where('status',1)->sum('extract_price');
|
||||
return $price ? $price : 0;
|
||||
}
|
||||
|
||||
|
||||
@ -46,7 +46,7 @@ class UserLevel extends BaseModel
|
||||
{
|
||||
$data=self::setWhere($where,'a')->group('a.uid')->order('grade desc')
|
||||
->field('a.*,u.nickname,u.avatar')
|
||||
->join('__user__ u','a.uid=u.uid')->page((int)$where['page'],(int)$where['limit'])->select();
|
||||
->join('user u','a.uid=u.uid')->page((int)$where['page'],(int)$where['limit'])->select();
|
||||
$data=count($data) ? $data->toArray() : [];
|
||||
foreach ($data as &$item){
|
||||
$info=SystemUserLevel::where('id',$item['level_id'])->find();
|
||||
@ -57,7 +57,7 @@ class UserLevel extends BaseModel
|
||||
$item['is_forever']= $item['is_forever'] ? '永久会员':'限时会员';
|
||||
$item['valid_time']=$item['is_forever'] ? '永久':date('Y-m-d H:i:s',$item['valid_time']);
|
||||
}
|
||||
$count=self::setWhere($where,'a')->group('a.level_id')->order('grade desc')->join('__user__ u','a.uid=u.uid')->count();
|
||||
$count=self::setWhere($where,'a')->group('a.level_id')->order('grade desc')->join('user u','a.uid=u.uid')->count();
|
||||
return compact('data','count');
|
||||
}
|
||||
|
||||
|
||||
@ -77,7 +77,7 @@ class UserPoint extends BaseModel
|
||||
->ExcelSave();
|
||||
}
|
||||
public static function setWhere($where){
|
||||
$model=UserBill::alias('a')->join('__user__ b','a.uid=b.uid','left')->where('a.category','integral');
|
||||
$model=UserBill::alias('a')->join('user b','a.uid=b.uid','left')->where('a.category','integral');
|
||||
$time['data']='';
|
||||
if($where['start_time']!='' && $where['end_time']!=''){
|
||||
$time['data']=$where['start_time'].' - '.$where['end_time'];
|
||||
|
||||
@ -44,7 +44,7 @@ use crmeb\services\PHPExcelService;
|
||||
$model = $model->where('A.recharge_type','weixin');
|
||||
$model = $model->where('A.paid',1);
|
||||
$model = $model->field('A.*,B.nickname');
|
||||
$model = $model->join('__user__ B','A.uid = B.uid','RIGHT');
|
||||
$model = $model->join('user B','A.uid = B.uid','RIGHT');
|
||||
$model = $model->order('A.id desc');
|
||||
|
||||
return self::page($model,$where);
|
||||
|
||||
@ -170,7 +170,7 @@ use app\admin\model\order\StoreOrderStatus;
|
||||
$model=$model->alias($alias)->join('user u','a.uid=u.uid')->order('u.uid desc');
|
||||
$alias.='.';
|
||||
}
|
||||
$status = (int)SystemConfigService::get('store_brokerage_statu');
|
||||
$status = (int)sysConfig('store_brokerage_statu');
|
||||
if ($status == 1) {
|
||||
if ($Listuids = User::where(['is_promoter' => 1])->field('uid')->select()) {
|
||||
$newUids = [];
|
||||
@ -209,7 +209,7 @@ use app\admin\model\order\StoreOrderStatus;
|
||||
*/
|
||||
public static function agentSystemPage($where = array()){
|
||||
$model=self::setSpreadWhere($where);
|
||||
$status =SystemConfigService::get('store_brokerage_statu');
|
||||
$status =sysConfig('store_brokerage_statu');
|
||||
if(isset($where['excel']) && $where['excel'] == 1){
|
||||
$list = $model->field(['a.uid','u.phone','a.nickname','a.sex','a.country','a.province','a.city','a.now_money','a.subscribe','u.brokerage_price'])->select()->toArray();
|
||||
$export = [];
|
||||
@ -235,7 +235,7 @@ use app\admin\model\order\StoreOrderStatus;
|
||||
$uids = array_merge($uids);
|
||||
}
|
||||
$item['extract_sum_price'] = self::getModelTime($where,UserExtract::where('uid',$item['uid']))->sum('extract_price');
|
||||
$item['extract_count_price'] = UserExtract::getUserCountPrice($item['uid'].$where);//累计提现金额
|
||||
$item['extract_count_price'] = UserExtract::getUserCountPrice($item['uid']);//累计提现金额
|
||||
$item['extract_count_num'] = UserExtract::getUserCountNum($item['uid'],$where);//提现次数
|
||||
$item['order_price'] = count($uids) ? StoreOrder::where('uid','in',$uids)->where(['paid'=>1,'refund_status'=>0])->sum('pay_price') : 0;//订单金额
|
||||
$item['order_count'] = count($uids) ? StoreOrder::where('uid','in',$uids)->where(['paid'=>1,'refund_status'=>0])->count() : 0;//订单数量
|
||||
@ -298,7 +298,7 @@ use app\admin\model\order\StoreOrderStatus;
|
||||
$uids = array_merge($uids);
|
||||
}
|
||||
$item['extract_sum_price'] = self::getModelTime($where,UserExtract::where('uid',$item['uid']))->sum('extract_price');
|
||||
$item['extract_count_price'] = UserExtract::getUserCountPrice($item['uid'],$where);//累计提现金额
|
||||
$item['extract_count_price'] = UserExtract::getUserCountPrice($item['uid']);//累计提现金额
|
||||
$item['extract_count_num'] = UserExtract::getUserCountNum($item['uid'],$where);//提现次数
|
||||
$item['order_price'] = count($uids) ? StoreOrder::where('uid','in',$uids)->where(['paid'=>1,'refund_status'=>0])->sum('pay_price') : 0;//订单金额
|
||||
$item['order_count'] = count($uids) ? StoreOrder::where('uid','in',$uids)->where(['paid'=>1,'refund_status'=>0])->count() : 0;//订单数量
|
||||
@ -539,7 +539,7 @@ use app\admin\model\order\StoreOrderStatus;
|
||||
public static function getStairList($where)
|
||||
{
|
||||
if(!isset($where['uid'])) return [];
|
||||
$data = self::setSairWhere($where,new User())->page((int)$where['page'],(int)$where['limit'])->select();
|
||||
$data = self::setSairWhere($where,new User())->order('add_time desc')->page((int)$where['page'],(int)$where['limit'])->select();
|
||||
$data = count($data) ? $data->toArray() : [];
|
||||
$userInfo = User::where('uid',$where['uid'])->find();
|
||||
foreach ($data as &$item){
|
||||
@ -719,7 +719,7 @@ use app\admin\model\order\StoreOrderStatus;
|
||||
|
||||
public static function clearUserTag()
|
||||
{
|
||||
Cache::deleteItem('_wechat_tag');
|
||||
Cache::delete('_wechat_tag');
|
||||
}
|
||||
|
||||
public static function getUserGroup()
|
||||
@ -739,7 +739,7 @@ use app\admin\model\order\StoreOrderStatus;
|
||||
public static function clearUserGroup()
|
||||
{
|
||||
|
||||
Cache::deleteItem('_wechat_group');
|
||||
Cache::delete('_wechat_group');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -253,16 +253,15 @@
|
||||
$eb.$swal('delete',function(){
|
||||
$eb.axios.get(url).then(function(res){
|
||||
if(res.status == 200 && res.data.code == 200) {
|
||||
$eb.$swal('success',res.data.msg);
|
||||
obj.del();
|
||||
$eb.$swal('success',res.data.msg)
|
||||
}else
|
||||
return Promise.reject(res.data.msg || '清除失败')
|
||||
}).catch(function(err){
|
||||
$eb.$swal('error',err);
|
||||
});
|
||||
},{
|
||||
title:'您将解除【'+data.nickname+'】的推广权限,请谨慎操作!',
|
||||
text:'解除后可在会员管理里面开启',
|
||||
title:'您将解除【'+data.nickname+'】的上级推广人,请谨慎操作!',
|
||||
text:'解除后无法恢复',
|
||||
confirm:'是的我要解除'
|
||||
})
|
||||
break;
|
||||
|
||||
@ -38,12 +38,12 @@
|
||||
</span>
|
||||
</a>
|
||||
<ul class="dropdown-menu animated fadeInRight m-t-xs">
|
||||
<li><a class="J_menuItem admin_close" href="{:Url('setting.systemAdmin/adminInfo')}">个人资料</a>
|
||||
<li><a class="J_menuItem admin_close" href="{:Url('setting.systemAdmin/admin_info')}">个人资料</a>
|
||||
</li>
|
||||
<li><a class="admin_close" target="_blank" href="http://www.crmeb.com/">联系我们</a>
|
||||
</li>
|
||||
<li class="divider"></li>
|
||||
<li><a href="{:Url('Login/logout')}">安全退出</a>
|
||||
<li><a href="{:Url('login/logout')}">安全退出</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
@ -159,43 +159,28 @@
|
||||
<div id="right-sidebar">
|
||||
<div class="sidebar-container">
|
||||
<ul class="nav nav-tabs navs-3">
|
||||
<!-- <li class="active">-->
|
||||
<!-- <a data-toggle="tab" href="#tab-1">-->
|
||||
<!-- <i class="fa fa-bell"></i>通知-->
|
||||
<!-- </a>-->
|
||||
<!-- </li>-->
|
||||
<li class="active">
|
||||
<a data-toggle="tab" href="#tab-1">
|
||||
<i class="fa fa-bell"></i>通知
|
||||
</a>
|
||||
</li>
|
||||
<li class="">
|
||||
<a data-toggle="tab" href="#tab-2">
|
||||
<i class="fa fa-gear"></i> 设置
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<!-- <div id="tab-1" class="tab-pane active">-->
|
||||
<!-- <div class="sidebar-title">-->
|
||||
<!-- <h3><i class="fa fa-comments-o"></i> 最新通知</h3>-->
|
||||
<!-- <small><i class="fa fa-tim"></i> 您当前有0条未读信息</small>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<div id="tab-1" class="tab-pane active">
|
||||
<div class="sidebar-title">
|
||||
<h3><i class="fa fa-comments-o"></i> 最新通知</h3>
|
||||
<small><i class="fa fa-tim"></i> 您当前有0条未读信息</small>
|
||||
</div>
|
||||
<div>
|
||||
<!--<div class="sidebar-message">
|
||||
<a href="#">
|
||||
<div class="pull-left text-center">
|
||||
<img alt="image" class="img-circle message-avatar" src="http://ozwpnu2pa.bkt.clouddn.com/a1.jpg">
|
||||
<div class="m-t-xs">
|
||||
<i class="fa fa-star text-warning"></i> <i class="fa fa-star text-warning"></i>
|
||||
</div>
|
||||
</div>
|
||||
<div class="media-body">
|
||||
|
||||
据天津日报报道:瑞海公司董事长于学伟,副董事长董社轩等10人在13日上午已被控制。 <br>
|
||||
<small class="text-muted">今天 4:21 <a class="J_menuItem admin_close" href="/admin/setting.system_admin/admininfo.html" data-index="0">【查看】</a></small>
|
||||
</div>
|
||||
</a>
|
||||
</div>-->
|
||||
</div>
|
||||
</div>
|
||||
<div id="tab-2" class="tab-pane ">
|
||||
<div class="sidebar-title">
|
||||
<h3><i class="fa fa-comments-o"></i> 提示</h3>
|
||||
<small><i class="fa fa-tim"></i> 你可以从这里选择和预览主题的布局和样式,这些设置会被保存在本地,下次打开的时候会直接应用这些设置。</small>
|
||||
|
||||
@ -8,6 +8,7 @@
|
||||
<meta name="generator" content="CRMEB! v2.5" />
|
||||
<meta name="author" content="CRMEB! Team and CRMEB UI Team" />
|
||||
<link href="{__FRAME_PATH}css/bootstrap.min.css?v=3.4.0" rel="stylesheet">
|
||||
<link href="{__PLUG_PATH}layui/css/layui.css" rel="stylesheet">
|
||||
<link href="{__FRAME_PATH}css/font-awesome.min.css?v=4.3.0" rel="stylesheet">
|
||||
<link href="{__FRAME_PATH}css/animate.min.css" rel="stylesheet">
|
||||
<link href="{__FRAME_PATH}css/style.min.css?v=3.0.0" rel="stylesheet">
|
||||
@ -22,7 +23,7 @@
|
||||
<h3 class="login-logo">
|
||||
<img src="{__ADMIN_PATH}images/logo.png">
|
||||
</h3>
|
||||
<form role="form" action="{:url('verify')}" method="post">
|
||||
<form role="form" action="{:url('verify')}" method="post" id="form" onsubmit="return false">
|
||||
<div class="form-group">
|
||||
<div class="input-group m-b"><span class="input-group-addon"><i class="fa fa-user"></i> </span>
|
||||
<input type="text" id="account" name="account" placeholder="用户名" placeholder="用户名" class="form-control">
|
||||
@ -42,11 +43,6 @@
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<strong>
|
||||
<p class="text-danger" id="err" style="display: none;"></p>
|
||||
</strong>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary block full-width m-b">登 录</button>
|
||||
<?php /* <p class="text-muted text-center"> <a href="{:url('./forgetpwd')}"><small>忘记密码了?</small></a> | <a href="{:url('./register')}">注册一个新账号</a>
|
||||
</p> */ ?>
|
||||
@ -63,6 +59,7 @@
|
||||
<script src="{__FRAME_PATH}js/bootstrap.min.js?v=3.4.0"></script>
|
||||
<script src="{__MODULE_PATH}login/flaotfont.js"></script>
|
||||
<script src="{__MODULE_PATH}login/ios-parallax.js"></script>
|
||||
<script src="{__PLUG_PATH}layui/layui.all.js"></script>
|
||||
<script src="{__MODULE_PATH}login/index.js"></script>
|
||||
<!--统计代码,可删除-->
|
||||
<!--点击刷新验证码-->
|
||||
|
||||
@ -224,7 +224,7 @@
|
||||
<i class="fa fa-motorcycle"></i> 去送货
|
||||
</a>
|
||||
</li>
|
||||
{{# if(d.use_integral > 0 && d.use_integral >= d.back_integral){ }}
|
||||
{{# if(parseFloat(d.use_integral) > 0 && parseFloat(d.use_integral) > parseFloat(d.back_integral)){ }}
|
||||
<li>
|
||||
<a lay-event='marke' href="javascript:void(0);">
|
||||
<i class="fa fa-paste"></i> 订单备注
|
||||
@ -280,7 +280,7 @@
|
||||
<i class="fa fa-history"></i> 立即退款
|
||||
</a>
|
||||
</li>
|
||||
{{# }else if(d.use_integral > 0 && d.use_integral >= d.back_integral){ }}
|
||||
{{# }else if(parseFloat(d.use_integral) > 0 && parseFloat(d.use_integral) > parseFloat(d.back_integral)){ }}
|
||||
<li>
|
||||
<a href="javascript:void(0);" onclick="$eb.createModalFrame('退积分','{:Url('integral_back')}?id={{d.id}}')">
|
||||
<i class="fa fa-history"></i> 退积分
|
||||
@ -313,7 +313,7 @@
|
||||
</a>
|
||||
</li>
|
||||
{{# };}}
|
||||
{{# if(d.use_integral > 0 && d.use_integral >= d.back_integral){ }}
|
||||
{{# if(parseFloat(d.use_integral) > 0 && parseFloat(d.use_integral) > parseFloat(d.back_integral)){ }}
|
||||
<li>
|
||||
<a href="javascript:void(0);" onclick="$eb.createModalFrame('退积分','{:Url('integral_back')}?id={{d.id}}')">
|
||||
<i class="fa fa-history"></i> 退积分
|
||||
@ -346,7 +346,7 @@
|
||||
</a>
|
||||
</li>
|
||||
{{# } }}
|
||||
{{# if(d.use_integral > 0 && d.use_integral >= d.back_integral){ }}
|
||||
{{# if(parseFloat(d.use_integral) > 0 && parseFloat(d.use_integral) >= parseFloat(d.back_integral)){ }}
|
||||
<li>
|
||||
<a href="javascript:void(0);" onclick="$eb.createModalFrame('退积分','{:Url('integral_back')}?id={{d.id}}')">
|
||||
<i class="fa fa-history"></i> 退积分
|
||||
|
||||
@ -22,6 +22,7 @@
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
window.$f = null
|
||||
formCreate.formSuccess = function(form,$r){
|
||||
<?=$form->getSuccessScript()?>
|
||||
//刷新父级页面
|
||||
@ -51,7 +52,7 @@
|
||||
if(_b) return ;
|
||||
_b = true;
|
||||
if (!el) el = document.body;
|
||||
var $f = formCreate.create(getRule(), {
|
||||
$f = formCreate.create(getRule(), {
|
||||
el: el,
|
||||
form:<?=json_encode($form->getConfig('form'))?>,
|
||||
row:<?=json_encode($form->getConfig('row'))?>,
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
<script>
|
||||
$eb = parent._mpApi;
|
||||
window.controlle="<?php echo strtolower(trim(preg_replace("/[A-Z]/", "_\\0", app('request')->controller()), "_"));?>";
|
||||
window.module="<?php echo app('request')->app();?>";
|
||||
window.module="<?php echo app('http')->getName();?>";
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
131
crmeb/app/admin/view/setting/system_admin/admin_info.php
Normal file
131
crmeb/app/admin/view/setting/system_admin/admin_info.php
Normal file
@ -0,0 +1,131 @@
|
||||
{extend name="public/container"}
|
||||
{block name="head"}
|
||||
<style>
|
||||
label.error{
|
||||
color: #a94442;
|
||||
margin-bottom: 0;
|
||||
display: inline-block;
|
||||
font: normal normal normal 14px/1 FontAwesome;
|
||||
font-size: inherit;
|
||||
text-rendering: auto;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
transform: translate(0, 0);
|
||||
}
|
||||
</style>
|
||||
<link href="{__FRAME_PATH}css/plugins/iCheck/custom.css" rel="stylesheet">
|
||||
<script src="{__ADMIN_PATH}plug/validate/jquery.validate.js"></script>
|
||||
<script src="{__ADMIN_PATH}frame/js/plugins/iCheck/icheck.min.js"></script>
|
||||
<script src="{__ADMIN_PATH}frame/js/ajaxfileupload.js"></script>
|
||||
{/block}
|
||||
{block name="content"}
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="ibox">
|
||||
<div class="ibox-title">
|
||||
<div class="text-left">个人资料</div>
|
||||
<div class="ibox-tools">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="ibox-content">
|
||||
<form method="post" class="form-horizontal" id="signupForm" action="">
|
||||
<input type="hidden" value="{$adminInfo.id}" name="id"/>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">账号</label>
|
||||
<div class="col-sm-10">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<input type="text" class="form-control" name="account" value="{$adminInfo.account}" validate="" disabled/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hr-line-dashed"></div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">姓名</label>
|
||||
<div class="col-sm-10">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<input type="text" class="form-control" name="real_name" value="{$adminInfo.real_name}" validate="required:true" id="real_name"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hr-line-dashed"></div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">原始密码</label>
|
||||
<div class="col-sm-10">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<input type="password" class="form-control" name="pwd" id="pwd"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hr-line-dashed"></div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">新密码</label>
|
||||
<div class="col-sm-10">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<input type="password" class="form-control" name="new_pwd" id="new_pwd"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hr-line-dashed"></div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">确认新密码</label>
|
||||
<div class="col-sm-10">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<input type="password" class="form-control" name="new_pwd_ok" id="new_pwd_ok"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="hr-line-dashed"></div>
|
||||
<div class="form-group" style="text-align: center;">
|
||||
<div class="col-sm-4 col-sm-offset-2">
|
||||
<button class="btn btn-primary add" type="button">提交</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
{block name="script"}
|
||||
|
||||
<script>
|
||||
$eb = parent._mpApi;
|
||||
$().ready(function() {
|
||||
$("#signupForm").validate();
|
||||
})
|
||||
$('.add').on('click',function (e) {
|
||||
var list = [];
|
||||
list.real_name = $('#real_name').val();
|
||||
list.pwd = $('#pwd').val();
|
||||
list.new_pwd = $('#new_pwd').val();
|
||||
list.new_pwd_ok = $('#new_pwd_ok').val();
|
||||
if(list.real_name.length < 1) return $eb.message('error','请填写姓名');
|
||||
var url = "{:Url('setAdminInfo')}";
|
||||
$.ajax({
|
||||
url:url,
|
||||
data:{real_name:list.real_name,pwd:list.pwd,new_pwd:list.new_pwd,new_pwd_ok:list.new_pwd_ok},
|
||||
type:'post',
|
||||
dataType:'json',
|
||||
success:function (re) {
|
||||
if(re.code == 400)
|
||||
return $eb.message('error',re.msg);
|
||||
else
|
||||
return $eb.message('success',re.msg);
|
||||
}
|
||||
})
|
||||
})
|
||||
</script>
|
||||
{/block}
|
||||
@ -4,9 +4,9 @@
|
||||
<meta charset="UTF-8">
|
||||
<title><?=$form->getTitle()?></title>
|
||||
|
||||
<link href="{__FRAME_PATH}css/bootstrap.min.css?v=3.4.0" rel="stylesheet">
|
||||
<link href="{__ADMIN_PATH}css/layui-admin.css" rel="stylesheet">
|
||||
<link href="{__FRAME_PATH}css/style.min.css?v=3.0.0" rel="stylesheet">
|
||||
<link href="{__FRAME_PATH}/css/bootstrap.min.css?v=3.4.0" rel="stylesheet">
|
||||
<link href="{__ADMIN_PATH}/css/layui-admin.css" rel="stylesheet">
|
||||
<link href="{__FRAME_PATH}/css/style.min.css?v=3.0.0" rel="stylesheet">
|
||||
<link href="{__FRAME_PATH}css/font-awesome.min.css?v=4.3.0" rel="stylesheet">
|
||||
<script src="{__PLUG_PATH}vue/dist/vue.min.js"></script>
|
||||
<link href="{__PLUG_PATH}iview/dist/styles/iview.css" rel="stylesheet">
|
||||
@ -65,7 +65,7 @@
|
||||
<script>
|
||||
formCreate.formSuccess = function(form,$r){
|
||||
<?=$form->getSuccessScript()?>
|
||||
$f.btn.loading(false)();
|
||||
$r.btn.loading(false);
|
||||
};
|
||||
|
||||
(function () {
|
||||
|
||||
@ -157,7 +157,7 @@
|
||||
|
||||
<button class="btn btn-info btn-xs" type="button" onclick="$eb.createModalFrame('编辑','{:Url('setting.system_config/edit_config',array('id'=>$vo['id']))}')"><i class="fa fa-paste"></i> 编辑</button>
|
||||
|
||||
<button class="btn btn-warning btn-xs del_config_tab" data-id="{$vo.id}" type="button" data-url="{:Url('setting.system_config/delete_cinfig',array('id'=>$vo['id']))}" ><i class="fa fa-warning"></i> 删除
|
||||
<button class="btn btn-warning btn-xs del_config_tab" data-id="{$vo.id}" type="button" data-url="{:Url('setting.system_config/delete_config',array('id'=>$vo['id']))}" ><i class="fa fa-warning"></i> 删除
|
||||
|
||||
</button>
|
||||
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
.message-content-btn {text-align: center;padding: 10px 0;}
|
||||
.media-body .message-but{margin-top: 10px;}
|
||||
.message-content .message-content-btn .layui-btn {height: auto;line-height: 26px;padding: 5px 30px;font-size: 16px;}
|
||||
.message-content .homepage-bottom .layadmin-privateletterlist-item .meida-left img{width: 151px;height: 81px;}
|
||||
.message-content .homepage-bottom .layadmin-privateletterlist-item .meida-left img{width: 100%;}
|
||||
.message-content .homepage-bottom .layadmin-privateletterlist-item{border: 1px solid #e0e0e0;margin-bottom: 10px;cursor:pointer;}
|
||||
.message-content .homepage-bottom .layadmin-privateletterlist-item .meida-right{padding: 10px;}
|
||||
.message-content .homepage-bottom .layadmin-privateletterlist-item.on{border: 1px solid #0092DC!important;}
|
||||
@ -75,9 +75,7 @@
|
||||
<div class="layui-card-header" style="padding-top: 10px;">
|
||||
<div style="height: 30px;line-height: 30px;float:left;" >评论产品</div>
|
||||
<div style="height: 30px;line-height: 30px;float: right;">
|
||||
<input style="display: inline;width: auto;" type="text" class="layui-input layui-input-search" v-model="where.product_name" placeholder="搜索产品">
|
||||
<button class="layui-btn layui-btn-primary layui-btn-sm" type="button" style="height: 32px;line-height: 32px;" @click="seachs"><i class="layui-icon layui-icon-search"></i>搜索</button>
|
||||
<button class="layui-btn layui-btn-primary layui-btn-sm" type="button" style="height: 32px;line-height: 32px;margin-left: 0;" @click="Reset"><i class="layui-icon layui-icon-refresh-3"></i>重置</button>
|
||||
<input style="display: inline;width: auto;" type="text" class="layui-input layui-input-search" v-model="where.product_name" @blur='seachs' placeholder="搜索产品">
|
||||
</div>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
@ -126,7 +124,7 @@
|
||||
</div>
|
||||
<div class="message-text">
|
||||
<p v-text="item.comment"></p>
|
||||
<div class="image-box" v-if="item.pics.length">
|
||||
<div class="image-box" v-if="item.pics && typeof item.pics == 'object'">
|
||||
<img :src="pic" alt="" v-for="pic in item.pics" @click="lockImage(pic)">
|
||||
</div>
|
||||
</div>
|
||||
@ -263,8 +261,8 @@
|
||||
if(that.product.loadend) return;
|
||||
that.product.loadTitle='加载中';
|
||||
layList.baseGet(layList.U({a:'get_product_imaes_list',q:that.where}),function (res) {
|
||||
var list=res.data;
|
||||
var loadend=list.length < that.where.limit;
|
||||
var list = res.data;
|
||||
var loadend = list.length < that.where.limit;
|
||||
that.where.page=that.where.page+1;
|
||||
that.product.loading=false;
|
||||
that.product.loadend=loadend;
|
||||
|
||||
@ -1,58 +1,118 @@
|
||||
{include file="public/frame_head"}
|
||||
<style>
|
||||
.panel{
|
||||
width: 100%;margin-top:20px; text-align: left;padding: 20px 40px;
|
||||
}
|
||||
.panel button{display: block;margin:5px;}
|
||||
.clear_tit span{font-size: 12px; color: #ED4014;margin: 15px 0;}
|
||||
.clear_box{border: 1px solid #DADFE6;border-radius: 3px;display: flex;flex-direction: column;align-items: center;padding: 30px 10px;box-sizing:border-box}
|
||||
.clear_box_sp1{font-size: 16px;color: #000000;display: block;}
|
||||
.clear_box_sp2{font-size: 14px;color: #ED4014;display: block;margin: 12px 0;}
|
||||
.layui-btn-danger {background-color: #FF5722;}
|
||||
</style>
|
||||
<div class="col-sm-12">
|
||||
<blockquote class="text-warning" style="font-size:14px">清除数据请谨慎,清除就无法恢复哦!
|
||||
</blockquote>
|
||||
|
||||
<hr>
|
||||
<div class="layui-fluid">
|
||||
<div class="layui-row layui-col-space15" id="app">
|
||||
<div class="layui-col-md12">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body">
|
||||
<blockquote class="layui-elem-quote layui-quote-nm">
|
||||
清除数据请谨慎,清除就无法恢复哦!
|
||||
</blockquote>
|
||||
<div class="clear_box layui-col-md3 layui-col-lg3 layui-col-sm3" v-for="item in clearData">
|
||||
<span class="clear_box_sp1">{{item.name}}</span>
|
||||
<span class="clear_box_sp2" v-if="item.info">{{item.info}}</span>
|
||||
<button type="primary" class="layui-btn layui-btn-danger cleardata" @click="unDate(item)">立即清理</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row panel">
|
||||
|
||||
<button type="button" class="btn btn-w-m btn-danger btn-primary cleardata" data-url="{:Url('system.SystemCleardata/userRelevantData')}">清除用户数据</button><br>
|
||||
<button type="button" class="btn btn-w-m btn-danger btn-primary cleardata" data-url="{:Url('system.SystemCleardata/storeData')}">清除商城数据</button><br>
|
||||
<button type="button" class="btn btn-w-m btn-danger btn-primary cleardata" data-url="{:Url('system.SystemCleardata/categoryData')}">清除产品分类</button><br>
|
||||
<button type="button" class="btn btn-w-m btn-danger btn-primary cleardata" data-url="{:Url('system.SystemCleardata/orderData')}">清除订单数据</button><br>
|
||||
<button type="button" class="btn btn-w-m btn-danger btn-primary cleardata" data-url="{:Url('system.SystemCleardata/kefuData')}">清除客服数据</button><br>
|
||||
<button type="button" class="btn btn-w-m btn-danger btn-primary cleardata" data-url="{:Url('system.SystemCleardata/wechatData')}">清除微信数据</button><br>
|
||||
<button type="button" class="btn btn-w-m btn-danger btn-primary cleardata" data-url="{:Url('system.SystemCleardata/wechatuserData')}">清除微信用户</button><br>
|
||||
<button type="button" class="btn btn-w-m btn-danger btn-primary cleardata" data-url="{:Url('system.SystemCleardata/articleData')}">清除内容分类</button><br>
|
||||
<button type="button" class="btn btn-w-m btn-danger btn-primary cleardata" data-url="{:Url('system.SystemCleardata/uploadData')}">清除所有附件</button><br>
|
||||
<button type="button" class="btn btn-w-m btn-danger btn-primary cleardata" data-url="{:Url('system.SystemCleardata/systemdata')}">清除系统记录</button><br>
|
||||
<!--<button type="button" class="btn btn-w-m btn-danger btn-primary creatuser" data-url="{:Url('system.SystemCleardata/userdate')}">创建前台用户用户名:crmeb 密码:123456</button>-->
|
||||
</div>
|
||||
<script type="text/javascript" src="/static/plug/vue/dist/vue.min.js"></script>
|
||||
<script>
|
||||
$('.cleardata').on('click',function(){
|
||||
window.t = $(this);
|
||||
var _this = $(this),url =_this.data('url');
|
||||
$eb.$swal('delete',function(){
|
||||
$eb.axios.get(url).then(function(res){
|
||||
if(res.status == 200 && res.data.code == 200) {
|
||||
$eb.$swal('success',res.data.msg);
|
||||
}else
|
||||
return Promise.reject(res.data.msg || '操作失败')
|
||||
}).catch(function(err){
|
||||
$eb.$swal('error',err);
|
||||
});
|
||||
},{'title':'您确定要进行此操作吗?','text':'数据清除无法恢复','confirm':'是的,我要操作'})
|
||||
});
|
||||
$('.creatuser').on('click',function(){
|
||||
window.t = $(this);
|
||||
var _this = $(this),url =_this.data('url');
|
||||
$eb.$swal('delete',function(){
|
||||
$eb.axios.get(url).then(function(res){
|
||||
if(res.status == 200 && res.data.code == 200) {
|
||||
$eb.$swal('success',res.data.msg);
|
||||
}else
|
||||
return Promise.reject(res.data.msg || '操作失败')
|
||||
}).catch(function(err){
|
||||
$eb.$swal('error',err);
|
||||
});
|
||||
},{'title':'您确定要进行此操作吗?','text':'用户数据清除之后才能进行此操作','confirm':'是的,我要操作'})
|
||||
})
|
||||
new Vue({
|
||||
data:{
|
||||
clearData:[
|
||||
{
|
||||
name:'清除用户生成的临时附件',
|
||||
info:'清除用户生成的临时附件,不会影响产品图',
|
||||
url:"{:Url('system.SystemCleardata/undata',['type'=>1])}"
|
||||
},
|
||||
{
|
||||
name: '清除回收站产品',
|
||||
info:'清除回收站产品,谨慎操作',
|
||||
url: "{:Url('system.SystemCleardata/undata',['type'=>2])}",
|
||||
},
|
||||
{
|
||||
name:'清除用户数据',
|
||||
info:'用户相关的所有表都将被清除,谨慎操作',
|
||||
url: "{:Url('system.SystemCleardata/userRelevantData')}",
|
||||
},
|
||||
{
|
||||
name:'清除商城数据',
|
||||
info:'清除商城数据,谨慎操作',
|
||||
url: "{:Url('system.SystemCleardata/storeData')}",
|
||||
},
|
||||
{
|
||||
name:'清除产品分类',
|
||||
info:"会清除所有产品分类,谨慎操作",
|
||||
url:"{:Url('system.SystemCleardata/categoryData')}",
|
||||
},
|
||||
{
|
||||
name:"清除订单数据",
|
||||
info:'清除用户所有订单数据,谨慎操作',
|
||||
url:"{:Url('system.SystemCleardata/orderData')}",
|
||||
},
|
||||
{
|
||||
name:'清除客服数据',
|
||||
info:'清除添加的客服数据,谨慎操作',
|
||||
url:"{:Url('system.SystemCleardata/kefuData')}",
|
||||
},
|
||||
{
|
||||
name:'清除微信数据',
|
||||
info:'清除微信菜单保存数据,微信关键字无效回复',
|
||||
url:"{:Url('system.SystemCleardata/wechatData')}",
|
||||
},
|
||||
{
|
||||
name:'清除微信用户',
|
||||
info:"清除用户表和微信用户表,谨慎操作",
|
||||
url:"{:Url('system.SystemCleardata/wechatuserData')}"
|
||||
},
|
||||
{
|
||||
name:'清除内容分类',
|
||||
info:'清除添加的文章和文章分类,谨慎操作',
|
||||
url:"{:Url('system.SystemCleardata/articleData')}",
|
||||
},
|
||||
{
|
||||
name:'清除所有附件',
|
||||
info:'清除所有附件用户生成和后台上传,谨慎操作',
|
||||
url:"{:Url('system.SystemCleardata/uploadData')}",
|
||||
},
|
||||
{
|
||||
name:'清除系统记录',
|
||||
info:'清除系统记录,谨慎操作',
|
||||
url:"{:Url('system.SystemCleardata/systemdata')}",
|
||||
}
|
||||
],
|
||||
},
|
||||
methods:{
|
||||
unDate:function (item) {
|
||||
$eb.$swal('delete',function(){
|
||||
$eb.axios.get(item.url).then(function(res){
|
||||
if(res.status == 200 && res.data.code == 200) {
|
||||
$eb.$swal('success',res.data.msg);
|
||||
}else
|
||||
return Promise.reject(res.data.msg || '操作失败')
|
||||
}).catch(function(err){
|
||||
$eb.$swal('error',typeof err == 'object' ? err.toString() : err);
|
||||
});
|
||||
},{'title':'您确定要'+item.name+'吗?','text':'数据清除无法恢复','confirm':'是的,我要操作'})
|
||||
}
|
||||
},
|
||||
mounted:function () {
|
||||
|
||||
}
|
||||
}).$mount(document.getElementById('app'));
|
||||
|
||||
</script>
|
||||
{include file="public/inner_footer"}
|
||||
|
||||
@ -3,8 +3,8 @@
|
||||
<head>
|
||||
{include file="public/head"}
|
||||
|
||||
<link href="{__FRAME_PATH}css/bootstrap.min.css?v=3.4.0" rel="stylesheet">
|
||||
<link href="{__FRAME_PATH}css/style.min.css?v=3.0.0" rel="stylesheet">
|
||||
<link href="/system/frame/css/bootstrap.min.css?v=3.4.0" rel="stylesheet">
|
||||
<link href="/system/frame/css/style.min.css?v=3.0.0" rel="stylesheet">
|
||||
<title>{$title|default=''}</title>
|
||||
<style></style>
|
||||
</head>
|
||||
@ -39,8 +39,8 @@
|
||||
<Form-Item>
|
||||
<Row>
|
||||
<i-Col span="13">
|
||||
<span>门店电话:</span>
|
||||
<i-Input placeholder="门店电话" v-model="form.phone" style="width: 80%" type="text"></i-Input>
|
||||
<span>门店手机号:</span>
|
||||
<i-Input placeholder="门店手机号" v-model="form.phone" style="width: 80%" type="text"></i-Input>
|
||||
</i-Col>
|
||||
</Row>
|
||||
</Form-Item>
|
||||
@ -89,7 +89,7 @@
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
<div class="ivu-upload" style="display: inline-block; width: 58px;" @click="openWindows('选择图片','{:Url('widget.images/index',['fodder'=>'image'])}')" v-if="!form.image">
|
||||
<div class="ivu-upload" style="display: inline-block; width: 58px;" @click="openWindows('选择图片','{:Url('widget.images/index',['fodder'=>'image'])}',{w:900,h:550})" v-if="!form.image">
|
||||
<div class="ivu-upload ivu-upload-drag">
|
||||
<div style="width: 58px; height: 58px; line-height: 58px;">
|
||||
<i class="ivu-icon ivu-icon-camera" style="font-size: 20px;"></i>
|
||||
@ -146,7 +146,7 @@
|
||||
}
|
||||
});
|
||||
new Vue({
|
||||
data() {
|
||||
data:function() {
|
||||
return {
|
||||
id:storeData.id || 0,
|
||||
addresData:city,
|
||||
@ -191,6 +191,7 @@
|
||||
},
|
||||
handleChange:function(value,selectedData){
|
||||
var that = this;
|
||||
that.form.address = [];
|
||||
$.each(selectedData,function (key,item) {
|
||||
that.form.address.push(item.label);
|
||||
});
|
||||
|
||||
30
crmeb/app/admin/view/system/system_store/select_address.php
Normal file
30
crmeb/app/admin/view/system/system_store/select_address.php
Normal file
@ -0,0 +1,30 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
{include file="public/head"}
|
||||
<title>{$title|default=''}</title>
|
||||
<style>
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body id="body" style="position: absolute;height: 100%;width: 100%">
|
||||
<iframe id="mapPage" width="100%" height="100%" frameborder=0
|
||||
src="https://3gimg.qq.com/lightmap/components/locationPicker2/index.html?type=1&key={$key}&referer=myapp">
|
||||
</iframe>
|
||||
</body>
|
||||
<script>
|
||||
window.onload=function(){
|
||||
document.getElementById('body').style.height=document.body.clientHeight+'px';
|
||||
}
|
||||
mpFrame.start(function(layer) {
|
||||
window.addEventListener('message',function (evevt) {
|
||||
if(evevt.data){
|
||||
parent.selectAdderss(evevt.data);
|
||||
var index = parent.layer.getFrameIndex(window.name);
|
||||
parent.layer.close(index);
|
||||
}else{
|
||||
return layer.msg('请选择地图');
|
||||
}
|
||||
});
|
||||
})
|
||||
</script>
|
||||
@ -30,7 +30,7 @@
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="m-b-md">
|
||||
<h2>在线升级 <span style="font-size: 5px;color: red">当前版本为:{{version}}</span></h2>
|
||||
<h2>在线升级 <span style="font-size: 12px;color: red">当前版本为:{{version}}</span></h2>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -51,7 +51,7 @@
|
||||
<input type='checkbox' name='id' disabled lay-skin='switch' value="{{d.id}}" lay-filter='is_forever' lay-text='永久|非永久' {{ d.is_forever == 1 ? 'checked' : '' }}>
|
||||
</script>
|
||||
<script type="text/html" id="is_show">
|
||||
<input type='checkbox' name='id' lay-skin='switch' value="{{d.id}}" lay-filter='is_show' lay-text='显示|隐藏' {{ d.is_show == 1 ? 'checked' : '' }}>
|
||||
<input type='checkbox' name='id' lay-skin='switch' value="{{d.id}}" lay-filter='is_show' lay-text='开启|关闭' {{ d.is_show == 1 ? 'checked' : '' }}>
|
||||
</script>
|
||||
<script type="text/html" id="is_pay">
|
||||
<input type='checkbox' name='id' disabled lay-skin='switch' value="{{d.id}}" lay-filter='is_pay' lay-text='付费|免费' {{ d.is_pay == 1 ? 'checked' : '' }}>
|
||||
@ -94,11 +94,10 @@
|
||||
{field: 'icon', title: '等级图标',templet:'#icon',align:"center",width:'10%'},
|
||||
{field: 'name', title: '等级名称',edit:'name',width:'6%',align:"center"},
|
||||
{field: 'grade', title: '等级',edit:'grade',width:'6%',align:"center"},
|
||||
{field: 'discount', title: '享受折扣',edit:'discount',width:'6%',align:"center"},
|
||||
{field: 'discount', title: '享受折扣',edit:'discount',width:'8%',align:"center"},
|
||||
{field: 'valid_date', title: '有效时间',width:'12%',align:"center"},
|
||||
{field: 'is_forever', title: '是否永久',templet:'#is_forever',width:'6%',align:"center"},
|
||||
{field: 'is_pay', title: '是否付费',templet:'#is_pay',width:'8%',align:"center"},
|
||||
{field: 'is_show', title: '是否显示',templet:'#is_show',width:'6%',align:"center"},
|
||||
{field: 'is_forever', title: '是否永久',templet:'#is_forever',width:'8%',align:"center"},
|
||||
{field: 'is_show', title: '是否使用',templet:'#is_show',width:'8%',align:"center"},
|
||||
{field: 'explain', title: '等级说明',align:"center"},
|
||||
{field: 'right', title: '操作',align:'center',toolbar:'#act',width:'8%'},
|
||||
];
|
||||
|
||||
@ -53,7 +53,7 @@
|
||||
<img style="cursor: pointer" lay-event='open_image' src="{{d.image}}">
|
||||
</script>
|
||||
<script type="text/html" id="is_show">
|
||||
<input type='checkbox' name='id' lay-skin='switch' value="{{d.id}}" lay-filter='is_show' lay-text='显示|隐藏' {{ d.is_show == 1 ? 'checked' : '' }}>
|
||||
<input type='checkbox' name='id' lay-skin='switch' value="{{d.id}}" lay-filter='is_show' lay-text='开启|关闭' {{ d.is_show == 1 ? 'checked' : '' }}>
|
||||
</script>
|
||||
<script type="text/html" id="is_must">
|
||||
<input type='checkbox' name='id' lay-skin='switch' value="{{d.id}}" lay-filter='is_must' lay-text='全部完成|达成其一' {{ d.is_must == 1 ? 'checked' : '' }}>
|
||||
@ -84,7 +84,7 @@
|
||||
{field: 'level_name', title: '等级名称',},
|
||||
{field: 'name', title: '任务名称',},
|
||||
{field: 'sort', title: '排序',sort: true,event:'sort',edit:'sort',width:'7%'},
|
||||
{field: 'is_show', title: '是否显示',templet:'#is_show',width:'10%'},
|
||||
{field: 'is_show', title: '是否使用',templet:'#is_show',width:'10%'},
|
||||
{field: 'is_must', title: '务必达成',templet:'#is_must',width:'15%'},
|
||||
{field: 'illustrate', title: '任务说明'},
|
||||
{field: 'right', title: '操作',align:'center',toolbar:'#act',width:'13%'},
|
||||
|
||||
@ -65,9 +65,9 @@
|
||||
<div class="operation-item">
|
||||
<!-- <span class="glyphicon glyphicon-chevron-up" aria-hidden="true" @click="itemUp(index)"></span>-->
|
||||
<!-- <span class="glyphicon glyphicon-chevron-down" aria-hidden="true" @click="itemDown(index)"></span>-->
|
||||
<span class="glyphicon glyphicon-trash" aria-hidden="true" @click="itemDel(index)"></span>
|
||||
<span class="glyphicon glyphicon-trash" aria-hidden="true" v-if="index" @click="itemDel(index)"></span>
|
||||
</div>
|
||||
<div v-if="index==0">
|
||||
<div v-if="index == 0">
|
||||
<div class="news-item transition news-image" :class="action==index ? 'active' :''" style="margin-bottom: 20px" @click="isShow(index)">
|
||||
<img :src="item.image_input" style="width: 100%;height: 100%;"/>
|
||||
</div>
|
||||
@ -191,8 +191,10 @@
|
||||
if(that.newList.length == 1) return $eb.message('error','不能再删除了');
|
||||
that.newList.splice(indexItem,1);
|
||||
if(indexItem == that.indexItem){
|
||||
if(that.newList.length == 1) that.setNewListIndex(0);
|
||||
else that.setNewListIndex(parseInt(indexItem) + parseInt(1));
|
||||
if(that.newList.length == 1)
|
||||
that.setNewListIndex(0);
|
||||
else
|
||||
that.setNewListIndex(parseInt(indexItem) + parseInt(1));
|
||||
}else{
|
||||
if(indexItem < that.indexItem){
|
||||
that.indexItem = parseInt(that.indexItem) + parseInt(1);
|
||||
@ -259,7 +261,7 @@
|
||||
'title':'',
|
||||
'author':$author,
|
||||
'content':'',
|
||||
'image_input':'{__MODULE_PATH}wechat/news/images/image.png',
|
||||
'image_input':'{__MODULE_PATH}/wechat/news/images/image.png',
|
||||
'synopsis':''
|
||||
}
|
||||
this.newList.push(arr);
|
||||
|
||||
@ -36,18 +36,18 @@ class PublicController
|
||||
$menus = GroupDataService::getData('routine_home_menus') ?: [];//TODO 首页按钮
|
||||
$roll = GroupDataService::getData('routine_home_roll_news') ?: [];//TODO 首页滚动新闻
|
||||
$activity = GroupDataService::getData('routine_home_activity', 3) ?: [];//TODO 首页活动区域图片
|
||||
$site_name = SystemConfigService::get('site_name');
|
||||
$site_name = sysConfig('site_name');
|
||||
$routine_index_page = GroupDataService::getData('routine_index_page');
|
||||
$info['fastInfo'] = $routine_index_page[0]['fast_info'] ?? '';//SystemConfigService::get('fast_info');//TODO 快速选择简介
|
||||
$info['bastInfo'] = $routine_index_page[0]['bast_info'] ?? '';//SystemConfigService::get('bast_info');//TODO 精品推荐简介
|
||||
$info['firstInfo'] = $routine_index_page[0]['first_info'] ?? '';//SystemConfigService::get('first_info');//TODO 首发新品简介
|
||||
$info['salesInfo'] = $routine_index_page[0]['sales_info'] ?? '';//SystemConfigService::get('sales_info');//TODO 促销单品简介
|
||||
$logoUrl = SystemConfigService::get('routine_index_logo');//TODO 促销单品简介
|
||||
if (strstr($logoUrl, 'http') === false) $logoUrl = SystemConfigService::get('site_url') . $logoUrl;
|
||||
$info['fastInfo'] = $routine_index_page[0]['fast_info'] ?? '';//sysConfig('fast_info');//TODO 快速选择简介
|
||||
$info['bastInfo'] = $routine_index_page[0]['bast_info'] ?? '';//sysConfig('bast_info');//TODO 精品推荐简介
|
||||
$info['firstInfo'] = $routine_index_page[0]['first_info'] ?? '';//sysConfig('first_info');//TODO 首发新品简介
|
||||
$info['salesInfo'] = $routine_index_page[0]['sales_info'] ?? '';//sysConfig('sales_info');//TODO 促销单品简介
|
||||
$logoUrl = sysConfig('routine_index_logo');//TODO 促销单品简介
|
||||
if (strstr($logoUrl, 'http') === false) $logoUrl = sysConfig('site_url') . $logoUrl;
|
||||
$logoUrl = str_replace('\\', '/', $logoUrl);
|
||||
$fastNumber = $routine_index_page[0]['fast_number'] ?? 6;//SystemConfigService::get('fast_number');//TODO 快速选择分类个数
|
||||
$bastNumber = $routine_index_page[0]['bast_number'] ?? 6;//SystemConfigService::get('bast_number');//TODO 精品推荐个数
|
||||
$firstNumber = $routine_index_page[0]['first_number'] ?? 6;//SystemConfigService::get('first_number');//TODO 首发新品个数
|
||||
$fastNumber = $routine_index_page[0]['fast_number'] ?? 6;//sysConfig('fast_number');//TODO 快速选择分类个数
|
||||
$bastNumber = $routine_index_page[0]['bast_number'] ?? 6;//sysConfig('bast_number');//TODO 精品推荐个数
|
||||
$firstNumber = $routine_index_page[0]['first_number'] ?? 6;//sysConfig('first_number');//TODO 首发新品个数
|
||||
$info['fastList'] = StoreCategory::byIndexList((int)$fastNumber);//TODO 快速选择分类个数
|
||||
$info['bastList'] = StoreProduct::getBestProduct('id,image,store_name,cate_id,price,ot_price,IFNULL(sales,0) + IFNULL(ficti,0) as sales,unit_name', (int)$bastNumber, $request->uid());//TODO 精品推荐个数
|
||||
$info['firstList'] = StoreProduct::getNewProduct('id,image,store_name,cate_id,price,unit_name,IFNULL(sales,0) + IFNULL(ficti,0) as sales', (int)$firstNumber,$request->uid());//TODO 首发新品个数
|
||||
@ -65,11 +65,11 @@ class PublicController
|
||||
*/
|
||||
public function share()
|
||||
{
|
||||
$data['img'] = SystemConfigService::get('wechat_share_img');
|
||||
if (strstr($data['img'], 'http') === false) $data['img'] = SystemConfigService::get('site_url') . $data['img'];
|
||||
$data['img'] = sysConfig('wechat_share_img');
|
||||
if (strstr($data['img'], 'http') === false) $data['img'] = sysConfig('site_url') . $data['img'];
|
||||
$data['img'] = str_replace('\\', '/', $data['img']);
|
||||
$data['title'] = SystemConfigService::get('wechat_share_title');
|
||||
$data['synopsis'] = SystemConfigService::get('wechat_share_synopsis');
|
||||
$data['title'] = sysConfig('wechat_share_title');
|
||||
$data['synopsis'] = sysConfig('wechat_share_synopsis');
|
||||
return app('json')->successful(compact('data'));
|
||||
}
|
||||
|
||||
@ -86,15 +86,20 @@ class PublicController
|
||||
{
|
||||
$menusInfo = GroupDataService::getData('routine_my_menus') ?? [];
|
||||
$user = $request->user();
|
||||
$vipOpen = sysConfig('vip_open');
|
||||
$vipOpen = is_string($vipOpen) ? (int)$vipOpen : $vipOpen;
|
||||
foreach ($menusInfo as $key=>&$value){
|
||||
$value['pic'] = UtilService::setSiteUrl($value['pic']);
|
||||
if($value['id'] == 137 && !(intval(SystemConfigService::get('store_brokerage_statu')) == 2 || $user->is_promoter == 1))
|
||||
if($value['id'] == 137 && !(intval(sysConfig('store_brokerage_statu')) == 2 || $user->is_promoter == 1))
|
||||
unset($menusInfo[$key]);
|
||||
if($value['id'] == 174 && !StoreService::orderServiceStatus($user->uid))
|
||||
unset($menusInfo[$key]);
|
||||
if(!StoreService::orderServiceStatus($user->uid) && $value['wap_url'] === '/order/order_cancellation'){
|
||||
if(!StoreService::orderServiceStatus($user->uid) && $value['wap_url'] === '/order/order_cancellation')
|
||||
unset($menusInfo[$key]);
|
||||
if($value['wap_url'] == '/user/vip' && !$vipOpen)
|
||||
unset($menusInfo[$key]);
|
||||
if($value['wap_url'] == '/customer/index' && !StoreService::orderServiceStatus($user->uid))
|
||||
unset($menusInfo[$key]);
|
||||
}
|
||||
}
|
||||
return app('json')->successful(['routine_my_menus'=>$menusInfo]);
|
||||
}
|
||||
|
||||
@ -299,7 +299,7 @@ class StoreBargainController
|
||||
$price = StoreBargainUserHelp::getSurplusPrice($bargainId, $user['uid']);//TODO 获取砍价剩余金额
|
||||
$alreadyPrice = StoreBargainUser::getBargainUserPrice(StoreBargainUser::getBargainUserTableId($bargainId, $user['uid']));
|
||||
try{
|
||||
$siteUrl = SystemConfigService::get('site_url');
|
||||
$siteUrl = sysConfig('site_url');
|
||||
$data['title'] = $storeBargainInfo['title'];
|
||||
$data['image'] = $storeBargainInfo['image'];
|
||||
$data['price'] = bcsub($storeBargainInfo['price'],$alreadyPrice,2);
|
||||
@ -311,7 +311,7 @@ class StoreBargainController
|
||||
$imageInfo = SystemAttachment::getInfo($name,'name');
|
||||
if(!$imageInfo){
|
||||
$valueData = 'id='.$bargainId.'&bargain='.$user['uid'];
|
||||
if($user['is_promoter'] || SystemConfigService::get('store_brokerage_statu') == 2) $valueData.='&pid='.$user['uid'];
|
||||
if($user['is_promoter'] || sysConfig('store_brokerage_statu') == 2) $valueData.='&pid='.$user['uid'];
|
||||
$res = RoutineCode::getPageCode('pages/activity/goods_bargain_details/index',$valueData,280);
|
||||
if(!$res) return app('json')->fail('二维码生成失败');
|
||||
$imageInfo = UploadService::getInstance()->setUploadPath('routine/activity/bargain/code')->imageStream($name,$res);
|
||||
|
||||
@ -31,7 +31,7 @@ class StoreCombinationController
|
||||
['limit',10],
|
||||
],$request, true);
|
||||
$combinationList = StoreCombination::getAll($page, $limit);
|
||||
if(!count($combinationList)) return app('json')->fail('暂无拼团');
|
||||
if(!count($combinationList)) return app('json')->successful([]);
|
||||
return app('json')->successful($combinationList->hidden(['info','product_id','images','mer_id','attr','sort','stock','sales','add_time','is_del','is_show','browse','cost','is_show','start_time','stop_time','description','postage','is_postage','is_host','mer_use','combination'])->toArray());
|
||||
}
|
||||
|
||||
@ -51,15 +51,17 @@ class StoreCombinationController
|
||||
//公众号
|
||||
$name = $id.'_combination_detail_wap.jpg';
|
||||
$imageInfo = SystemAttachment::getInfo($name,'name');
|
||||
$siteUrl = SystemConfigService::get('site_url');
|
||||
$siteUrl = sysConfig('site_url');
|
||||
if(!$imageInfo){
|
||||
$codeUrl = UtilService::setHttpType($siteUrl.'/activity/group_detail/'.$id, 1);//二维码链接
|
||||
$imageInfo = UtilService::getQRCodePath($codeUrl, $name);
|
||||
if(is_array($imageInfo)){
|
||||
SystemAttachment::attachmentAdd($imageInfo['name'],$imageInfo['size'],$imageInfo['type'],$imageInfo['dir'],$imageInfo['thumb_path'],1,$imageInfo['image_type'],$imageInfo['time'],2);
|
||||
$url = $imageInfo['dir'];
|
||||
}else
|
||||
}else {
|
||||
$url = '';
|
||||
$imageInfo = ['image_type'=>0];
|
||||
}
|
||||
}else $url = $imageInfo['att_dir'];
|
||||
if($imageInfo['image_type'] == 1)
|
||||
$url = $siteUrl.$url;
|
||||
@ -192,14 +194,14 @@ class StoreCombinationController
|
||||
$count = count($pinkAll)+1;
|
||||
$data['msg'] = '原价¥'.$storeCombinationInfo['product_price'].' 还差'.(int)bcsub((int)$pinkInfo['people'],$count,0).'人拼团成功';
|
||||
try{
|
||||
$siteUrl = SystemConfigService::get('site_url');
|
||||
$siteUrl = sysConfig('site_url');
|
||||
if($from == 'routine'){
|
||||
//小程序
|
||||
$name = $pinkId.'_'.$user['uid'].'_'.$user['is_promoter'].'_pink_share_routine.jpg';
|
||||
$imageInfo = SystemAttachment::getInfo($name,'name');
|
||||
if(!$imageInfo){
|
||||
$valueData = 'id='.$pinkId;
|
||||
if($user['is_promoter'] || SystemConfigService::get('store_brokerage_statu')==2) $valueData.='&pid='.$user['uid'];
|
||||
if($user['is_promoter'] || sysConfig('store_brokerage_statu')==2) $valueData.='&pid='.$user['uid'];
|
||||
$res = RoutineCode::getPageCode('pages/activity/goods_combination_status/index',$valueData,280);
|
||||
if(!$res) return app('json')->fail('二维码生成失败');
|
||||
$imageInfo = UploadService::getInstance()->setUploadPath('routine/activity/pink/code')->imageStream($name,$res);
|
||||
|
||||
@ -59,8 +59,8 @@ class StoreSeckillController
|
||||
}
|
||||
}
|
||||
}
|
||||
$data['lovely'] = SystemConfigService::get('seckill_header_banner');
|
||||
if(strstr($data['lovely'],'http') === false && strlen(trim($data['lovely']))) $data['lovely'] = SystemConfigService::get('site_url').$data['lovely'];
|
||||
$data['lovely'] = sysConfig('seckill_header_banner');
|
||||
if(strstr($data['lovely'],'http') === false && strlen(trim($data['lovely']))) $data['lovely'] = sysConfig('site_url').$data['lovely'];
|
||||
$data['lovely'] = str_replace('\\','/',$data['lovely']);
|
||||
$data['seckillTime'] = $seckillTime;
|
||||
$data['seckillTimeIndex'] = $seckillTimeIndex;
|
||||
@ -83,7 +83,7 @@ class StoreSeckillController
|
||||
['limit',0],
|
||||
],$request, true);
|
||||
if(!$time) return app('json')->fail('参数错误');
|
||||
$timeInfo = GroupDataService::getDataNumber($time);
|
||||
$timeInfo = GroupDataService::getDataNumber((int)$time);
|
||||
$activityEndHour = bcadd((int)$timeInfo['time'],(int)$timeInfo['continued'],0);
|
||||
$startTime = bcadd(strtotime(date('Y-m-d')),bcmul($timeInfo['time'],3600,0));
|
||||
$stopTime = bcadd(strtotime(date('Y-m-d')),bcmul($activityEndHour,3600,0));
|
||||
@ -110,15 +110,17 @@ class StoreSeckillController
|
||||
//公众号
|
||||
$name = $id.'_seckill_detail_wap.jpg';
|
||||
$imageInfo = SystemAttachment::getInfo($name,'name');
|
||||
$siteUrl = SystemConfigService::get('site_url');
|
||||
$siteUrl = sysConfig('site_url');
|
||||
if(!$imageInfo){
|
||||
$codeUrl = UtilService::setHttpType($siteUrl.'/activity/seckill_detail/'.$id.'/'.$time, 1);//二维码链接
|
||||
$imageInfo = UtilService::getQRCodePath($codeUrl, $name);
|
||||
if(is_array($imageInfo)){
|
||||
SystemAttachment::attachmentAdd($imageInfo['name'],$imageInfo['size'],$imageInfo['type'],$imageInfo['dir'],$imageInfo['thumb_path'],1,$imageInfo['image_type'],$imageInfo['time'],2);
|
||||
$url = $imageInfo['dir'];
|
||||
}else
|
||||
}else {
|
||||
$url = '';
|
||||
$imageInfo = ['image_type'=>0];
|
||||
}
|
||||
}else $url = $imageInfo['att_dir'];
|
||||
if($imageInfo['image_type'] == 1) $url = $siteUrl.$url;
|
||||
$storeInfo['image'] = UtilService::setSiteUrl($storeInfo['image'], $siteUrl);
|
||||
|
||||
@ -352,7 +352,7 @@ class StoreOrderController
|
||||
$refundData['pay_price'] = $orderInfo['pay_price'];
|
||||
$refundData['refund_price'] = $price;
|
||||
if($orderInfo['pay_type'] == 'weixin'){
|
||||
if($orderInfo['is_channel']){// 小程序
|
||||
if($orderInfo['is_channel'] == 1){// 小程序
|
||||
try{
|
||||
MiniProgramService::payOrderRefund($orderInfo['order_id'], $refundData);
|
||||
}catch(\Exception $e){
|
||||
|
||||
@ -3,15 +3,15 @@ namespace app\api\controller\order;
|
||||
|
||||
use app\admin\model\system\SystemAttachment;
|
||||
use app\models\routine\RoutineFormId;
|
||||
use app\models\store\{
|
||||
StoreBargainUser,
|
||||
use crmeb\repositories\OrderRepository;
|
||||
use app\models\store\{StoreBargainUser,
|
||||
StoreCart,
|
||||
StoreCouponUser,
|
||||
StoreOrder,
|
||||
StoreOrderCartInfo,
|
||||
StoreOrderStatus,
|
||||
StorePink,
|
||||
StoreProductReply
|
||||
};
|
||||
StoreProductReply};
|
||||
use app\models\system\SystemStore;
|
||||
use app\models\user\UserAddress;
|
||||
use app\models\user\UserLevel;
|
||||
@ -46,8 +46,8 @@ class StoreOrderController
|
||||
$cartInfo = $cartGroup['valid'];
|
||||
$priceGroup = StoreOrder::getOrderPriceGroup($cartInfo);
|
||||
$other = [
|
||||
'offlinePostage' => SystemConfigService::get('offline_postage'),
|
||||
'integralRatio' => SystemConfigService::get('integral_ratio')
|
||||
'offlinePostage' => sysConfig('offline_postage'),
|
||||
'integralRatio' => sysConfig('integral_ratio')
|
||||
];
|
||||
$usableCoupon = StoreCouponUser::beUsableCoupon($uid, $priceGroup['totalPrice']);
|
||||
$cartIdA = explode(',', $cartId);
|
||||
@ -79,8 +79,8 @@ class StoreOrderController
|
||||
}
|
||||
$data['userInfo'] = $user;
|
||||
$data['integralRatio'] = $other['integralRatio'];
|
||||
$data['offline_pay_status'] = (int)SystemConfigService::get('offline_pay_status') ?? (int)2;
|
||||
$data['store_self_mention']= (int)SystemConfigService::get('store_self_mention') ?? 0;//门店自提是否开启
|
||||
$data['offline_pay_status'] = (int)sysConfig('offline_pay_status') ?? (int)2;
|
||||
$data['store_self_mention']= (int)sysConfig('store_self_mention') ?? 0;//门店自提是否开启
|
||||
$data['system_store'] = ($res = SystemStore::getStoreDispose()) ? $res : [];//门店信息
|
||||
return app('json')->successful($data);
|
||||
}
|
||||
@ -167,7 +167,10 @@ class StoreOrderController
|
||||
return app('json')->status('ORDER_EXIST', '订单生成失败,你已经参加该团了,请先支付订单', ['orderId' => StoreOrder::getStoreIdPink($pinkId, $request->uid())]);
|
||||
}
|
||||
$isChannel = 1;
|
||||
if($from == 'weixin') $isChannel = 0;
|
||||
if($from == 'weixin')
|
||||
$isChannel = 0;
|
||||
elseif ($from == 'weixinh5')
|
||||
$isChannel = 2;
|
||||
$order = StoreOrder::cacheKeyCreateOrder($request->uid(), $key, $addressId, $payType, (int)$useIntegral, $couponId, $mark, $combinationId, $pinkId, $seckill_id, $bargainId, false, $isChannel,$shipping_type,$real_name,$phone);
|
||||
if($order === false) return app('json')->fail(StoreOrder::getErrorInfo('订单生成失败'));
|
||||
$orderId = $order['order_id'];
|
||||
@ -280,9 +283,26 @@ class StoreOrderController
|
||||
],$request,true);
|
||||
if (!$uni) return app('json')->fail('参数错误!');
|
||||
$order = StoreOrder::getUserOrderDetail($request->uid(), $uni);
|
||||
if (!$order) return app('json')->fail('订单不存在!');
|
||||
if ($order['paid']) return app('json')->fail('该订单已支付!');
|
||||
if ($order['pink_id']) if (StorePink::isPinkStatus($order['pink_id'])) return app('json')->fail('该订单已失效!');
|
||||
if (!$order)
|
||||
return app('json')->fail('订单不存在!');
|
||||
if ($order['paid'])
|
||||
return app('json')->fail('该订单已支付!');
|
||||
if ($order['pink_id']) if (StorePink::isPinkStatus($order['pink_id']))
|
||||
return app('json')->fail('该订单已失效!');
|
||||
|
||||
if($from == 'weixin') {//0
|
||||
if(in_array($order->is_channel,[1,2]))
|
||||
$order['order_id'] = mt_rand(100,999).'_'.$order['order_id'];
|
||||
}
|
||||
if($from == 'weixinh5'){//2
|
||||
if(in_array($order->is_channel,[0,1]))
|
||||
$order['order_id'] = mt_rand(100,999).'_'.$order['order_id'];
|
||||
}
|
||||
if($from == 'routine'){//1
|
||||
if(in_array($order->is_channel,[0,2]))
|
||||
$order['order_id'] = mt_rand(100,999).'_'.$order['order_id'];
|
||||
}
|
||||
|
||||
$order['pay_type'] = $paytype; //重新支付选择支付方式
|
||||
switch ($order['pay_type']) {
|
||||
case 'weixin':
|
||||
@ -369,7 +389,7 @@ class StoreOrderController
|
||||
if($order['shipping_type'] === 2 && $order['verify_code']){
|
||||
$name = $order['verify_code'].'.jpg';
|
||||
$imageInfo = SystemAttachment::getInfo($name,'name');
|
||||
$siteUrl = SystemConfigService::get('site_url');
|
||||
$siteUrl = sysConfig('site_url');
|
||||
if(!$imageInfo){
|
||||
$imageInfo = UtilService::getQRCodePath($order['verify_code'], $name);
|
||||
if(is_array($imageInfo)){
|
||||
@ -381,7 +401,7 @@ class StoreOrderController
|
||||
if(isset($imageInfo['image_type']) && $imageInfo['image_type'] == 1) $url = $siteUrl.$url;
|
||||
$order['code'] = $url;
|
||||
}
|
||||
$order['mapKey'] = SystemConfigService::get('tengxun_map_key');
|
||||
$order['mapKey'] = sysConfig('tengxun_map_key');
|
||||
return app('json')->successful('ok',StoreOrder::tidyOrder($order,true,true));
|
||||
}
|
||||
|
||||
@ -477,7 +497,7 @@ class StoreOrderController
|
||||
public function comment(Request $request)
|
||||
{
|
||||
$group = UtilService::postMore([
|
||||
['unique',''],['comment',''],['pics',[]],['product_score',5],['service_score',5]
|
||||
['unique',''],['comment',''],['pics',''],['product_score',5],['service_score',5]
|
||||
], $request);
|
||||
$unique = $group['unique'];
|
||||
unset($group['unique']);
|
||||
@ -496,13 +516,7 @@ class StoreOrderController
|
||||
else if($cartInfo['cart_info']['seckill_id']) $productId = $cartInfo['cart_info']['product_id'];
|
||||
else if($cartInfo['cart_info']['bargain_id']) $productId = $cartInfo['cart_info']['product_id'];
|
||||
else $productId = $cartInfo['product_id'];
|
||||
if(count($group['pics'])){
|
||||
$pics = [];
|
||||
foreach ($group['pics'] as $key=>&$item){
|
||||
if(strlen(trim($item))) $pics[] = $item;
|
||||
}
|
||||
$group['pics'] = $pics;
|
||||
}
|
||||
if($group['pics']) $group['pics'] = json_encode(explode(',',$group['pics']));
|
||||
$group = array_merge($group,[
|
||||
'uid'=>$uid,
|
||||
'oid'=>$cartInfo['oid'],
|
||||
@ -525,6 +539,7 @@ class StoreOrderController
|
||||
}
|
||||
StoreProductReply::commitTrans();
|
||||
event('UserCommented', $res);
|
||||
event('AdminNewPush');
|
||||
return app('json')->successful();
|
||||
}
|
||||
|
||||
@ -544,7 +559,7 @@ class StoreOrderController
|
||||
*/
|
||||
public function refund_reason()
|
||||
{
|
||||
$reason = SystemConfigService::get('stor_reason')?:[];//退款理由
|
||||
$reason = sysConfig('stor_reason')?:[];//退款理由
|
||||
$reason = str_replace("\r\n","\n",$reason);//防止不兼容
|
||||
$reason = explode("\n",$reason);
|
||||
return app('json')->successful($reason);
|
||||
@ -650,6 +665,9 @@ class StoreOrderController
|
||||
try{
|
||||
$orderInfo->status = 2;
|
||||
if($orderInfo->save()){
|
||||
OrderRepository::storeProductOrderTakeDeliveryAdmin($orderInfo);
|
||||
StoreOrderStatus::status($orderInfo->id,'take_delivery','已核销');
|
||||
event('ShortMssageSend',[$orderInfo['order_id'],'Receiving']);
|
||||
StoreOrder::commitTrans();
|
||||
return app('json')->success('核销成功');
|
||||
}else{
|
||||
|
||||
@ -60,9 +60,9 @@ class StoreProductController
|
||||
switch ($userType){
|
||||
case 'wechat':
|
||||
//公众号
|
||||
$name = $id.'_product_detail_'.$user['uid'].'_is_promoter_'.$user['is_promoter'].'.wap.jpg';
|
||||
$name = $id.'_product_detail_'.$user['uid'].'_is_promoter_'.$user['is_promoter'].'_wap.jpg';
|
||||
$imageInfo = SystemAttachment::getInfo($name,'name');
|
||||
$siteUrl = SystemConfigService::get('site_url');
|
||||
$siteUrl = sysConfig('site_url');
|
||||
if(!$imageInfo){
|
||||
$codeUrl = UtilService::setHttpType($siteUrl.'/detail/'.$id.'?spread='.$user['uid'], 1);//二维码链接
|
||||
$imageInfo = UtilService::getQRCodePath($codeUrl, $name);
|
||||
@ -77,10 +77,10 @@ class StoreProductController
|
||||
//小程序
|
||||
$name = $id.'_'.$user['uid'].'_'.$user['is_promoter'].'_product.jpg';
|
||||
$imageInfo = SystemAttachment::getInfo($name,'name');
|
||||
$siteUrl = SystemConfigService::get('site_url').DS;
|
||||
$siteUrl = sysConfig('site_url').DS;
|
||||
if(!$imageInfo){
|
||||
$data='id='.$id;
|
||||
if($user['is_promoter'] || SystemConfigService::get('store_brokerage_statu')==2) $data.='&pid='.$user['uid'];
|
||||
if($user['is_promoter'] || sysConfig('store_brokerage_statu')==2) $data.='&pid='.$user['uid'];
|
||||
$res = \app\models\routine\RoutineCode::getPageCode('pages/goods_details/index',$data,280);
|
||||
if(!$res) return app('json')->fail('二维码生成失败');
|
||||
$imageInfo = \crmeb\services\UploadService::getInstance()->setUploadPath('routine/product')->imageStream($name,$res);
|
||||
@ -110,15 +110,17 @@ class StoreProductController
|
||||
//公众号
|
||||
$name = $id.'_product_detail_wap.jpg';
|
||||
$imageInfo = SystemAttachment::getInfo($name,'name');
|
||||
$siteUrl = SystemConfigService::get('site_url');
|
||||
$siteUrl = sysConfig('site_url');
|
||||
if(!$imageInfo){
|
||||
$codeUrl = UtilService::setHttpType($siteUrl.'/detail/'.$id, 1);//二维码链接
|
||||
$imageInfo = UtilService::getQRCodePath($codeUrl, $name);
|
||||
if(is_array($imageInfo)){
|
||||
SystemAttachment::attachmentAdd($imageInfo['name'],$imageInfo['size'],$imageInfo['type'],$imageInfo['dir'],$imageInfo['thumb_path'],1,$imageInfo['image_type'],$imageInfo['time'],2);
|
||||
$url = $imageInfo['dir'];
|
||||
}else
|
||||
}else {
|
||||
$url = '';
|
||||
$imageInfo = ['image_type'=>0];
|
||||
}
|
||||
}else $url = $imageInfo['att_dir'];
|
||||
if($imageInfo['image_type'] == 1) $url = $siteUrl.$url;
|
||||
$storeInfo['image'] = UtilService::setSiteUrl($storeInfo['image'], $siteUrl);
|
||||
@ -140,7 +142,7 @@ class StoreProductController
|
||||
$data['productValue'] = $productValue;
|
||||
$data['priceName'] = 0;
|
||||
if($uid){
|
||||
$storeBrokerageStatus = SystemConfigService::get('store_brokerage_statu') ?? 1;
|
||||
$storeBrokerageStatus = sysConfig('store_brokerage_statu') ?? 1;
|
||||
if($storeBrokerageStatus == 2)
|
||||
$data['priceName'] = StoreProduct::getPacketPrice($storeInfo, $productValue);
|
||||
else{
|
||||
@ -163,8 +165,8 @@ class StoreProductController
|
||||
} else $data['replyChance'] = 0;
|
||||
$data['mer_id'] = $storeInfo['mer_id'];
|
||||
$data['system_store'] = ($res = SystemStore::getStoreDispose()) ? $res : [];
|
||||
$data['good_list'] = StoreProduct::getGoodList(18,'image,store_name,price,id');
|
||||
$data['mapKey'] = SystemConfigService::get('tengxun_map_key');
|
||||
$data['good_list'] = StoreProduct::getGoodList(18,'image,store_name,price,id,ot_price');
|
||||
$data['mapKey'] = sysConfig('tengxun_map_key');
|
||||
return app('json')->successful($data);
|
||||
}
|
||||
|
||||
@ -184,7 +186,7 @@ class StoreProductController
|
||||
['limit',0]
|
||||
], $request, true);
|
||||
if(!$limit) return app('json')->successful([]);
|
||||
$productHot = StoreProduct::getHotProductLoading('id,image,store_name,cate_id,price,unit_name',(int)$page,(int)$limit);
|
||||
$productHot = StoreProduct::getHotProductLoading('id,image,store_name,cate_id,price,unit_name,ot_price',(int)$page,(int)$limit);
|
||||
return app('json')->successful($productHot);
|
||||
}
|
||||
|
||||
|
||||
@ -151,7 +151,7 @@ class UserBillController
|
||||
try{
|
||||
$resRoutine = true;//小程序
|
||||
$resWap = true;//公众号
|
||||
$siteUrl = SystemConfigService::get('site_url');
|
||||
$siteUrl = sysConfig('site_url');
|
||||
$routineSpreadBanner = GroupDataService::getData('routine_spread_banner');
|
||||
if(!count($routineSpreadBanner)) return app('json')->fail('暂无海报');
|
||||
if($type == 1){
|
||||
@ -207,7 +207,7 @@ class UserBillController
|
||||
'angle'=>0,
|
||||
),
|
||||
array(
|
||||
'text'=>'邀请您加入'.SystemConfigService::get('site_name'),
|
||||
'text'=>'邀请您加入'.sysConfig('site_name'),
|
||||
'left'=>250,
|
||||
'top'=>880,
|
||||
'fontPath'=>$rootPath.'public'. DS .$filelink['Normal'], //字体文件
|
||||
@ -280,7 +280,7 @@ class UserBillController
|
||||
'angle'=>0,
|
||||
),
|
||||
array(
|
||||
'text'=>'邀请您加入'.SystemConfigService::get('site_name'),
|
||||
'text'=>'邀请您加入'.sysConfig('site_name'),
|
||||
'left'=>250,
|
||||
'top'=>880,
|
||||
'fontPath'=>$rootPath.'public'. DS .$filelink['Normal'], //字体文件
|
||||
|
||||
@ -86,8 +86,8 @@ class UserController
|
||||
$user['orderStatusSum'] = StoreOrder::getOrderStatusSum($user['uid']);//累计消费
|
||||
$user['extractTotalPrice'] = UserExtract::userExtractTotalPrice($user['uid']);//累计提现
|
||||
$user['extractPrice'] = $user['brokerage_price'];//可提现
|
||||
$user['statu'] = (int)SystemConfigService::get('store_brokerage_statu');
|
||||
if(!SystemConfigService::get('vip_open'))
|
||||
$user['statu'] = (int)sysConfig('store_brokerage_statu');
|
||||
if(!sysConfig('vip_open'))
|
||||
$user['vip']=false;
|
||||
else{
|
||||
$vipId=UserLevel::getUserLevel($user['uid']);
|
||||
@ -99,7 +99,7 @@ class UserController
|
||||
}
|
||||
}
|
||||
$user['yesterDay'] = UserBill::yesterdayCommissionSum($user['uid']);
|
||||
$user['recharge_switch'] = (int)SystemConfigService::get('recharge_switch');//充值开关
|
||||
$user['recharge_switch'] = (int)sysConfig('recharge_switch');//充值开关
|
||||
$user['adminid'] = (boolean)\app\models\store\StoreService::orderServiceStatus($user['uid']);
|
||||
if($user['phone'] && $user['user_type'] != 'h5'){
|
||||
$user['switchUserInfo'][] = $request->user();
|
||||
@ -427,7 +427,7 @@ class UserController
|
||||
}
|
||||
unset($user['pwd']);
|
||||
if(!$user['is_promoter']){
|
||||
$user['is_promoter']=(int)SystemConfigService::get('store_brokerage_statu') == 2 ? true : false;
|
||||
$user['is_promoter']=(int)sysConfig('store_brokerage_statu') == 2 ? true : false;
|
||||
}
|
||||
return app('json')->successful($user->hidden(['account','real_name','birthday','card_id','mark','partner_id','group_id','add_time','add_ip','phone','last_time','last_ip','spread_uid','spread_time','user_type','status','level','clean_time','addres'])->toArray());
|
||||
}
|
||||
@ -507,7 +507,7 @@ class UserController
|
||||
],$request);
|
||||
return app('json')->success([
|
||||
'rank' => User::brokerageRank($data),
|
||||
'position'=> User::currentUserRank($request->user()['brokerage_price'])
|
||||
'position'=> User::currentUserRank($data['type'],$request->user()['brokerage_price'])
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
@ -24,10 +24,10 @@ class UserExtractController
|
||||
{
|
||||
$user = $request->user();
|
||||
$data['commissionCount'] = $user['brokerage_price'];//可提现佣金
|
||||
$extractBank = SystemConfigService::get('user_extract_bank') ?? []; //提现银行
|
||||
$extractBank = sysConfig('user_extract_bank') ?? []; //提现银行
|
||||
$extractBank = str_replace("\r\n","\n",$extractBank);//防止不兼容
|
||||
$data['extractBank'] = explode("\n",is_array($extractBank) ? ( isset($extractBank[0]) ? $extractBank[0]: $extractBank): $extractBank);
|
||||
$data['minPrice'] = SystemConfigService::get('user_extract_min_price');//提现最低金额
|
||||
$data['minPrice'] = sysConfig('user_extract_min_price');//提现最低金额
|
||||
return app('json')->successful($data);
|
||||
}
|
||||
|
||||
|
||||
@ -24,7 +24,7 @@ class UserRechargeController
|
||||
{
|
||||
list($price,$type) = UtilService::postMore([['price',0],['type',0]], $request, true);
|
||||
if(!$price || $price <=0) return app('json')->fail('参数错误');
|
||||
$storeMinRecharge = SystemConfigService::get('store_user_min_recharge');
|
||||
$storeMinRecharge = sysConfig('store_user_min_recharge');
|
||||
if($price < $storeMinRecharge) return app('json')->fail('充值金额不能低于'.$storeMinRecharge);
|
||||
switch ((int)$type){
|
||||
case 0: //支付充值余额
|
||||
@ -58,7 +58,7 @@ class UserRechargeController
|
||||
{
|
||||
list($price, $from,$type) = UtilService::postMore([['price',0], ['from','weixin'],['type',0]], $request, true);
|
||||
if(!$price || $price <=0) return app('json')->fail('参数错误');
|
||||
$storeMinRecharge = SystemConfigService::get('store_user_min_recharge');
|
||||
$storeMinRecharge = sysConfig('store_user_min_recharge');
|
||||
if($price < $storeMinRecharge) return app('json')->fail('充值金额不能低于'.$storeMinRecharge);
|
||||
switch ((int)$type){
|
||||
case 0: //支付充值余额
|
||||
|
||||
@ -97,18 +97,18 @@ class AuthController
|
||||
public function get_logo(Request $request)
|
||||
{
|
||||
$logoType = $request->get('type',1);
|
||||
switch ((int)$logoType){
|
||||
switch ((int)$logoType) {
|
||||
case 1:
|
||||
$logo=SystemConfigService::get('routine_logo');
|
||||
$logo = sysConfig('routine_logo');
|
||||
break;
|
||||
case 2:
|
||||
$logo=SystemConfigService::get('wechat_avatar');
|
||||
$logo = sysConfig('wechat_avatar');
|
||||
break;
|
||||
default:
|
||||
$logo = '';
|
||||
break;
|
||||
}
|
||||
if(strstr($logo,'http')===false && $logo) $logo = SystemConfigService::get('site_url').$logo;
|
||||
if (strstr($logo,'http') === false && $logo) $logo = sysConfig('site_url').$logo;
|
||||
return app('json')->successful(['logo_url'=>str_replace('\\','/',$logo)]);
|
||||
}
|
||||
|
||||
|
||||
@ -93,9 +93,12 @@ if (!function_exists('make_path')) {
|
||||
|
||||
/**
|
||||
* 上传路径转化,默认路径
|
||||
* $type 类型
|
||||
* @param $path
|
||||
* @param int $type
|
||||
* @param bool $force
|
||||
* @return string
|
||||
*/
|
||||
function make_path($path,$type = 2)
|
||||
function make_path($path, int $type = 2, bool $force = false)
|
||||
{
|
||||
$path = DS.ltrim(rtrim($path));
|
||||
switch ($type){
|
||||
@ -114,8 +117,39 @@ if (!function_exists('make_path')) {
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if(!function_exists('sysConfig'))
|
||||
{
|
||||
/**
|
||||
* 获取系统单个配置
|
||||
* @param string $name
|
||||
* @return string | null
|
||||
*/
|
||||
function sysConfig(string $name)
|
||||
{
|
||||
if(empty($name))
|
||||
return null;
|
||||
|
||||
return app('sysConfig')->get($name);
|
||||
}
|
||||
}
|
||||
|
||||
if(!function_exists('sysData'))
|
||||
{
|
||||
/**
|
||||
* 获取系统单个配置
|
||||
* @param string $name
|
||||
* @return string
|
||||
*/
|
||||
function sysData($name)
|
||||
{
|
||||
return app('sysGroupData')->getData($name);
|
||||
}
|
||||
}
|
||||
@ -21,13 +21,13 @@ return [
|
||||
'HttpEnd' => [],
|
||||
'LogLevel' => [],
|
||||
'LogWrite' => [],
|
||||
'task_2'=>[],//2秒钟执行的方法
|
||||
'task_6'=>[],//6秒钟执行的方法
|
||||
'task_10'=>[],//10秒钟执行的方法
|
||||
'task_30'=>[],//30秒钟执行的方法
|
||||
'task_60'=>[],//60秒钟执行的方法
|
||||
'task_180'=>[],//180秒钟执行的方法
|
||||
'task_300'=>[],//300秒钟执行的方法
|
||||
'Task_2'=>[],//2秒钟执行的方法
|
||||
'Task_6'=>[],//6秒钟执行的方法
|
||||
'Task_10'=>[],//10秒钟执行的方法
|
||||
'Task_30'=>[],//30秒钟执行的方法
|
||||
'Task_60'=>[],//60秒钟执行的方法
|
||||
'Task_180'=>[],//180秒钟执行的方法
|
||||
'Task_300'=>[],//300秒钟执行的方法
|
||||
'StoreProductOrderDeliveryAfter' => [], // OrderSubscribe 送货 发送模板消息 admin模块 order.StoreOrder控制器/order.combinationOrder控制器
|
||||
'StoreProductOrderDeliveryGoodsAfter' => [], // OrderSubscribe 发货 发送模板消息 admin模块 order.StoreOrder控制器/order.combinationOrder控制器
|
||||
'StoreProductOrderRefundNAfter' => [], // OrderSubscribe 订单状态不退款 发送模板消息 admin模块 order.StoreOrder控制器/order.combinationOrder控制器
|
||||
@ -55,7 +55,8 @@ return [
|
||||
'UserCommented' => [], //用户评价商品
|
||||
'RechargeSuccess' => [], //用户充值成功后
|
||||
'ImportNowMoney' => [], //用户佣金转成余额成功后
|
||||
'ShortMssageSend'=>[],//MessageSubscribe 下发短信
|
||||
'ShortMssageSend' =>[],//MessageSubscribe 下发短信
|
||||
'AdminNewPush' => [],//MessageSubscribe 下单,评论,支付成功,后台消息提醒
|
||||
],
|
||||
|
||||
'subscribe' => [
|
||||
|
||||
@ -6,21 +6,51 @@ namespace app\http\middleware;
|
||||
|
||||
use app\Request;
|
||||
use crmeb\interfaces\MiddlewareInterface;
|
||||
use think\facade\Config;
|
||||
use think\Response;
|
||||
|
||||
/**
|
||||
* 跨域中间件
|
||||
* Class AllowOriginMiddleware
|
||||
* @package app\http\middleware
|
||||
*/
|
||||
class AllowOriginMiddleware implements MiddlewareInterface
|
||||
{
|
||||
/**
|
||||
* header头
|
||||
* @var array
|
||||
*/
|
||||
protected $header = [
|
||||
'Access-Control-Allow-Origin' => '*',
|
||||
'Access-Control-Allow-Headers' => 'Authori-zation,Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since, X-Requested-With',
|
||||
'Access-Control-Allow-Methods' => 'GET,POST,PATCH,PUT,DELETE,OPTIONS,DELETE',
|
||||
'Access-Control-Max-Age' => '1728000'
|
||||
];
|
||||
|
||||
/**
|
||||
* 允许跨域的域名
|
||||
* @var string
|
||||
*/
|
||||
protected $cookieDomain;
|
||||
|
||||
/**
|
||||
* @param Request $request
|
||||
* @param \Closure $next
|
||||
* @return Response
|
||||
*/
|
||||
public function handle(Request $request, \Closure $next)
|
||||
{
|
||||
header('Access-Control-Allow-Origin: *');
|
||||
header('Access-Control-Allow-Headers: Authori-zation,Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since, X-Requested-With');
|
||||
header('Access-Control-Allow-Methods: GET, POST, PATCH, PUT, DELETE');
|
||||
header('Access-Control-Max-Age: 1728000');
|
||||
$this->cookieDomain = Config::get('cookie.domain', '');
|
||||
$header = $this->header;
|
||||
$origin = $request->header('origin');
|
||||
|
||||
if ($request->isOptions()) {
|
||||
$response = new Response('ok');
|
||||
if ($origin && ('' != $this->cookieDomain && strpos($origin, $this->cookieDomain)))
|
||||
$header['Access-Control-Allow-Origin'] = $origin;
|
||||
|
||||
if ($request->method(true) == 'OPTIONS') {
|
||||
$response = Response::create('ok')->code(200)->header($header);
|
||||
} else {
|
||||
$response = $next($request);
|
||||
$response = $next($request)->header($header);
|
||||
}
|
||||
|
||||
return $response;
|
||||
|
||||
@ -14,6 +14,11 @@ use think\db\exception\DataNotFoundException;
|
||||
use think\db\exception\ModelNotFoundException;
|
||||
use think\exception\DbException;
|
||||
|
||||
/**
|
||||
* token验证中间件
|
||||
* Class AuthTokenMiddleware
|
||||
* @package app\http\middleware
|
||||
*/
|
||||
class AuthTokenMiddleware implements MiddlewareInterface
|
||||
{
|
||||
public function handle(Request $request, \Closure $next, bool $force = true)
|
||||
|
||||
@ -30,7 +30,7 @@ class Article extends BaseModel
|
||||
|
||||
public function profile()
|
||||
{
|
||||
return $this->hasOne(StoreProduct::class,'id','product_id')->field('store_name,image,price,id');
|
||||
return $this->hasOne(StoreProduct::class,'id','product_id')->field('store_name,image,price,id,ot_price');
|
||||
}
|
||||
|
||||
protected function getImageInputAttr($value)
|
||||
@ -51,7 +51,7 @@ class Article extends BaseModel
|
||||
if(!$id) return [];
|
||||
$list = self::where('status',1)->where('hide',0)->where('id',$id)->order('id desc')->find();
|
||||
if($list){
|
||||
$list->store_info = $list->profile ? StoreProduct::setLevelPrice($list->profile->toArray(),0,true) : null;
|
||||
$list->store_info = $list->profile ? $list->profile->toArray() : null;
|
||||
$list = $list->hidden(['hide','status','admin_id','mer_id'])->toArray();
|
||||
$list["content"] = Db::name('articleContent')->where('nid',$id)->value('content');
|
||||
return $list;
|
||||
@ -107,7 +107,7 @@ class Article extends BaseModel
|
||||
$model = $model->where('hide', 0);
|
||||
$model = $model->where('is_banner', 1);
|
||||
$model = $model->order('sort DESC,add_time DESC');
|
||||
$model = $model->limit(SystemConfigService::get('news_slides_limit') ?? 3);
|
||||
$model = $model->limit(sysConfig('news_slides_limit') ?? 3);
|
||||
return $model->select();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
namespace app\models\routine;
|
||||
|
||||
use crmeb\services\Template;
|
||||
use crmeb\utils\Template;
|
||||
use app\models\store\StoreOrder;
|
||||
use app\models\user\WechatUser;
|
||||
|
||||
@ -50,7 +50,6 @@ class RoutineTemplate
|
||||
$data['keyword2'] = $order['delivery_name'];
|
||||
$data['keyword3'] = $order['delivery_id'];
|
||||
$data['keyword4'] = date('Y-m-d H:i:s',time());
|
||||
$data['keyword5'] = '您的商品已经发货请注意查收';
|
||||
return self::sendOut('ORDER_DELIVER_SUCCESS',$order['uid'],$data);
|
||||
}
|
||||
}
|
||||
@ -148,7 +147,8 @@ class RoutineTemplate
|
||||
}else{
|
||||
$form['form_id']=$formId;
|
||||
}
|
||||
return Template::instance()->routine_two->sendTemplate($TempCode,$openid,$data,$form['form_id'],$link);
|
||||
return Template::instance()->routine()->setTemplateUrl($link)->setTemplateOpenId($openid)
|
||||
->setTemplateData($data)->setTemplateFormId($form['form_id'])->setTemplateCode($TempCode)->send();
|
||||
}catch (\Exception $e){
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -84,7 +84,7 @@ class StoreBargain extends BaseModel
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @throws \think\exception\DbException
|
||||
*/
|
||||
public static function getBargainTerm($bargainId = 0,$field = 'id,product_id,bargain_num,num,unit_name,image,title,price,min_price,image,description,start_time,stop_time,rule'){
|
||||
public static function getBargainTerm($bargainId = 0,$field = 'id,product_id,bargain_num,num,unit_name,image,title,price,min_price,image,description,start_time,stop_time,rule,info'){
|
||||
if(!$bargainId) return [];
|
||||
$model = self::validWhere();
|
||||
$bargain = $model->field($field)->where('id',$bargainId)->find();
|
||||
@ -179,11 +179,11 @@ class StoreBargain extends BaseModel
|
||||
*/
|
||||
public static function IncBargainStock($num,$bargainId)
|
||||
{
|
||||
$bargain=self::where('id',$bargainId)->field(['stock','sales'])->find();
|
||||
$bargain = self::where('id',$bargainId)->field(['stock','sales'])->find();
|
||||
if(!$bargain) return true;
|
||||
if($bargain->sales > 0) $bargain->sales=bcsub($bargain->sales,$num,0);
|
||||
if($bargain->sales < 0) $bargain->sales=0;
|
||||
$bargain->stock=bcadd($bargain->stock,$num,0);
|
||||
if($bargain->sales > 0) $bargain->sales = bcsub($bargain->sales,$num,0);
|
||||
if($bargain->sales < 0) $bargain->sales = 0;
|
||||
$bargain->stock = bcadd($bargain->stock,$num,0);
|
||||
return $bargain->save();
|
||||
}
|
||||
|
||||
|
||||
@ -79,9 +79,13 @@ class StoreCategory extends BaseModel
|
||||
return self::where('pid', '>', 0)->where('is_show', 1)->field($field)->order('sort DESC')->limit($limit)->select();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取子集分类查询条件
|
||||
* @return \think\model\relation\HasMany
|
||||
*/
|
||||
public function children()
|
||||
{
|
||||
return $this->hasMany(self::class, 'pid','id')->where('is_show',1);
|
||||
return $this->hasMany(self::class, 'pid','id')->where('is_show',1)->order('sort DESC,id DESC');
|
||||
}
|
||||
|
||||
}
|
||||
@ -163,11 +163,11 @@ class StoreCombination extends BaseModel
|
||||
public static function incCombinationStock($num,$CombinationId)
|
||||
{
|
||||
|
||||
$combination=self::where('id',$CombinationId)->field(['stock','sales'])->find();
|
||||
$combination = self::where('id',$CombinationId)->field(['stock','sales'])->find();
|
||||
if(!$combination) return true;
|
||||
if($combination->sales > 0) $combination->sales=bcsub($combination->sales,$num,0);
|
||||
if($combination->sales < 0) $combination->sales=0;
|
||||
$combination->stock=bcadd($combination->stock,$num,0);
|
||||
if($combination->sales > 0) $combination->sales = bcsub($combination->sales,$num,0);
|
||||
if($combination->sales < 0) $combination->sales = 0;
|
||||
$combination->stock = bcadd($combination->stock,$num,0);
|
||||
return $combination->save();
|
||||
}
|
||||
|
||||
|
||||
@ -39,7 +39,7 @@ class StoreCouponIssue extends BaseModel
|
||||
|
||||
public static function getIssueCouponList($uid, $limit, $page = 0)
|
||||
{
|
||||
$model = self::validWhere('A')->alias('A')->join('__store_coupon__ B', 'A.cid = B.id')
|
||||
$model = self::validWhere('A')->alias('A')->join('store_coupon B', 'A.cid = B.id')
|
||||
->field('A.*,B.coupon_price,B.use_min_price')->order('B.sort DESC,A.id DESC');
|
||||
if ($page) $list = $model->page((int)$page, (int)$limit);
|
||||
else $list = $model->limit($limit);
|
||||
@ -49,24 +49,24 @@ class StoreCouponIssue extends BaseModel
|
||||
$query->where('uid', $uid);
|
||||
}]);
|
||||
|
||||
$list = $list->select();
|
||||
$list = $list->select()->hidden(['is_del', 'status', 'used']);
|
||||
foreach ($list as $k=>$v) {
|
||||
$v['is_use'] = $uid ? isset($v->used) : false;
|
||||
// if(!$v['is_use']){
|
||||
// $v['is_use']=$v['remain_count'] <= 0 && !$v['is_permanent'] ? 2 : $v['is_use'];
|
||||
// }
|
||||
if(!$v['end_time']){
|
||||
$v['add_time']= '';
|
||||
$v['start_time']= '';
|
||||
$v['end_time'] = '不限时';
|
||||
}else{
|
||||
$v['add_time']=date('Y/m/d',$v['add_time']);
|
||||
$v['start_time']=date('Y/m/d',$v['start_time']);
|
||||
$v['end_time']=$v['end_time'] ? date('Y/m/d',$v['end_time']) : date('Y/m/d',time()+86400);
|
||||
}
|
||||
$v['coupon_price']=(int)$v['coupon_price'];
|
||||
$list[$k] = $v;
|
||||
}
|
||||
|
||||
return $list->hidden(['is_del', 'status', 'used', 'add_time'])->toArray();
|
||||
if($list)
|
||||
return $list->toArray();
|
||||
else
|
||||
return [];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -17,14 +17,13 @@ use app\models\user\UserBill;
|
||||
use app\models\user\WechatUser;
|
||||
use crmeb\basic\BaseModel;
|
||||
use crmeb\repositories\OrderRepository;
|
||||
use crmeb\services\CustomerService;
|
||||
use crmeb\repositories\UserRepository;
|
||||
use crmeb\services\MiniProgramService;
|
||||
use crmeb\services\SystemConfigService;
|
||||
use crmeb\services\WechatService;
|
||||
use crmeb\services\WechatTemplateService;
|
||||
use crmeb\services\workerman\ChannelService;
|
||||
use think\facade\Cache;
|
||||
use think\exception\PDOException;
|
||||
use crmeb\traits\ModelTrait;
|
||||
use think\facade\Log;
|
||||
use think\facade\Route;
|
||||
@ -77,8 +76,8 @@ class StoreOrder extends BaseModel
|
||||
*/
|
||||
public static function getOrderPriceGroup($cartInfo)
|
||||
{
|
||||
$storePostage = floatval(SystemConfigService::get('store_postage')) ?: 0;//邮费基础价
|
||||
$storeFreePostage = floatval(SystemConfigService::get('store_free_postage')) ?: 0;//满额包邮
|
||||
$storePostage = floatval(sysConfig('store_postage')) ?: 0;//邮费基础价
|
||||
$storeFreePostage = floatval(sysConfig('store_free_postage')) ?: 0;//满额包邮
|
||||
$totalPrice = self::getOrderSumPrice($cartInfo, 'truePrice');//获取订单总金额
|
||||
$costPrice = self::getOrderSumPrice($cartInfo, 'costPrice');//获取订单成本价
|
||||
$vipPrice = self::getOrderSumPrice($cartInfo, 'vip_truePrice');//获取订单会员优惠金额
|
||||
@ -119,8 +118,8 @@ class StoreOrder extends BaseModel
|
||||
*/
|
||||
public static function getCombinationOrderPriceGroup($cartInfo)
|
||||
{
|
||||
$storePostage = floatval(SystemConfigService::get('store_postage')) ?: 0;
|
||||
$storeFreePostage = floatval(SystemConfigService::get('store_free_postage')) ?: 0;
|
||||
$storePostage = floatval(sysConfig('store_postage')) ?: 0;
|
||||
$storeFreePostage = floatval(sysConfig('store_free_postage')) ?: 0;
|
||||
$totalPrice = self::getCombinationOrderTotalPrice($cartInfo);
|
||||
$costPrice = self::getCombinationOrderTotalPrice($cartInfo);
|
||||
if (!$storeFreePostage) {
|
||||
@ -189,7 +188,7 @@ class StoreOrder extends BaseModel
|
||||
*/
|
||||
public static function clearCacheOrderInfo($uid, $key)
|
||||
{
|
||||
Cache::deleteItem('user_order_' . $uid . $key);
|
||||
Cache::delete('user_order_' . $uid . $key);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -222,7 +221,7 @@ class StoreOrder extends BaseModel
|
||||
self::beginTrans();
|
||||
try{
|
||||
$shipping_type = (int)$shipping_type;
|
||||
$offlinePayStatus = (int)SystemConfigService::get('offline_pay_status') ?? (int)2;
|
||||
$offlinePayStatus = (int)sysConfig('offline_pay_status') ?? (int)2;
|
||||
if($offlinePayStatus == 2) unset(self::$payType['offline']);
|
||||
if (!array_key_exists($payType, self::$payType)) return self::setErrorInfo('选择支付方式有误!',true);
|
||||
if (self::be(['unique' => $key, 'uid' => $uid])) return self::setErrorInfo('请勿重复提交订单',true);
|
||||
@ -287,7 +286,7 @@ class StoreOrder extends BaseModel
|
||||
if (!$res1) return self::setErrorInfo('使用优惠劵失败!',true);
|
||||
|
||||
//$shipping_type = 1 快递发货 $shipping_type = 2 门店自提
|
||||
$store_self_mention = SystemConfigService::get('store_self_mention') ?? 0;
|
||||
$store_self_mention = sysConfig('store_self_mention') ?? 0;
|
||||
if(!$store_self_mention) $shipping_type = 1;
|
||||
if($shipping_type === 1) {
|
||||
//是否包邮
|
||||
@ -301,15 +300,18 @@ class StoreOrder extends BaseModel
|
||||
|
||||
//积分抵扣
|
||||
$res2 = true;
|
||||
$SurplusIntegral = 0;
|
||||
if ($useIntegral && $userInfo['integral'] > 0) {
|
||||
$deductionPrice = (float)bcmul($userInfo['integral'], $other['integralRatio'], 2);
|
||||
if ($deductionPrice < $payPrice) {
|
||||
$payPrice = bcsub($payPrice, $deductionPrice, 2);
|
||||
$usedIntegral = $userInfo['integral'];
|
||||
$SurplusIntegral = 0;
|
||||
$res2 = false !== User::edit(['integral' => 0], $userInfo['uid'], 'uid');
|
||||
} else {
|
||||
$deductionPrice = $payPrice;
|
||||
$usedIntegral = (float)bcdiv($payPrice, $other['integralRatio'], 2);
|
||||
$SurplusIntegral = bcsub($userInfo['integral'],$usedIntegral,2);
|
||||
$res2 = false !== User::bcDec($userInfo['uid'], 'integral', $usedIntegral, 'uid');
|
||||
$payPrice = 0;
|
||||
}
|
||||
@ -328,6 +330,7 @@ class StoreOrder extends BaseModel
|
||||
'pay_postage' => $payPostage,
|
||||
'coupon_price' => $couponPrice,
|
||||
'deduction_price' => $deductionPrice,
|
||||
'SurplusIntegral'=> $SurplusIntegral,
|
||||
];
|
||||
}
|
||||
$orderInfo = [
|
||||
@ -380,7 +383,8 @@ class StoreOrder extends BaseModel
|
||||
//购物车状态修改
|
||||
$res6 = false !== StoreCart::where('id', 'IN', $cartIds)->update(['is_pay' => 1]);
|
||||
if (!$res4 || !$res5 || !$res6) return self::setErrorInfo('订单生成失败!',true);
|
||||
GoodsRepository::storeProductOrderCreateEbApi($order, compact('cartInfo', 'addressId'));
|
||||
//自动设置默认地址
|
||||
UserRepository::storeProductOrderCreateEbApi($order, compact('cartInfo', 'addressId'));
|
||||
self::clearCacheOrderInfo($uid, $key);
|
||||
self::commitTrans();
|
||||
StoreOrderStatus::status($order['id'], 'cache_key_create_order', '订单生成');
|
||||
@ -572,7 +576,7 @@ class StoreOrder extends BaseModel
|
||||
if ($orderInfo['pay_price'] <= 0) exception('该支付无需支付!');
|
||||
$openid = WechatUser::getOpenId($orderInfo['uid']);
|
||||
$bodyContent = self::getProductTitle($orderInfo['cart_id']);
|
||||
$site_name = SystemConfigService::get('site_name');
|
||||
$site_name = sysConfig('site_name');
|
||||
if(!$bodyContent && !$site_name) exception('支付参数缺少:请前往后台设置->系统设置-> 填写 网站名称');
|
||||
return MiniProgramService::jsPay($openid, $orderInfo['order_id'], $orderInfo['pay_price'], 'productr',self::getSubstrUTf8($site_name.' - '.$bodyContent,30));
|
||||
}
|
||||
@ -597,7 +601,7 @@ class StoreOrder extends BaseModel
|
||||
if($orderInfo['pay_price'] <= 0) exception('该支付无需支付!');
|
||||
$openid = WechatUser::uidToOpenid($orderInfo['uid'],'openid');
|
||||
$bodyContent = self::getProductTitle($orderInfo['cart_id']);
|
||||
$site_name = SystemConfigService::get('site_name');
|
||||
$site_name = sysConfig('site_name');
|
||||
if(!$bodyContent && !$site_name) exception('支付参数缺少:请前往后台设置->系统设置-> 填写 网站名称');
|
||||
return WechatService::jsPay($openid,$orderInfo['order_id'],$orderInfo['pay_price'],'product',self::getSubstrUTf8($site_name.' - '.$bodyContent,30));
|
||||
}
|
||||
@ -621,7 +625,7 @@ class StoreOrder extends BaseModel
|
||||
if($orderInfo['paid']) exception('支付已支付!');
|
||||
if($orderInfo['pay_price'] <= 0) exception('该支付无需支付!');
|
||||
$bodyContent = self::getProductTitle($orderInfo['cart_id']);
|
||||
$site_name = SystemConfigService::get('site_name');
|
||||
$site_name = sysConfig('site_name');
|
||||
if(!$bodyContent && !$site_name) exception('支付参数缺少:请前往后台设置->系统设置-> 填写 网站名称');
|
||||
return WechatService::paymentPrepare(null,$orderInfo['order_id'],$orderInfo['pay_price'],'product',self::getSubstrUTf8($site_name.' - '.$bodyContent,30),'','MWEB');
|
||||
}
|
||||
@ -712,7 +716,7 @@ class StoreOrder extends BaseModel
|
||||
return self::setErrorInfo('申请退款失败!');
|
||||
else {
|
||||
try{
|
||||
$adminIds = SystemConfigService::get('site_store_admin_uids');
|
||||
$adminIds = sysConfig('site_store_admin_uids');
|
||||
if (!empty($adminIds)) {
|
||||
if (!($adminList = array_unique(array_filter(explode(',', trim($adminIds)))))) {
|
||||
return self::setErrorInfo('申请退款成功,');
|
||||
@ -747,42 +751,11 @@ class StoreOrder extends BaseModel
|
||||
$order = self::where('order_id', $orderId)->find();
|
||||
$resPink = true;
|
||||
$res1 = self::where('order_id', $orderId)->update(['paid' => 1, 'pay_type' => $paytype, 'pay_time' => time()]);//订单改为支付
|
||||
User::bcInc($order['uid'], 'pay_count', 1, 'uid');
|
||||
if ($order->combination_id && $res1 && !$order->refund_status) $resPink = StorePink::createPink($order);//创建拼团
|
||||
$oid = self::where('order_id', $orderId)->value('id');
|
||||
StoreOrderStatus::status($oid, 'pay_success', '用户付款成功');
|
||||
$openid = WechatUser::uidToOpenid($order['uid'], 'openid');
|
||||
$routineOpenid = WechatUser::uidToOpenid($order['uid'], 'routine_openid');
|
||||
try{
|
||||
if($openid){//公众号发送模板消息
|
||||
WechatTemplateService::sendTemplate($openid,WechatTemplateService::ORDER_PAY_SUCCESS, [
|
||||
'first'=>'亲,您购买的商品已支付成功',
|
||||
'keyword1'=>$orderId,
|
||||
'keyword2'=>$order['pay_price'],
|
||||
'remark'=>'点击查看订单详情'
|
||||
],Route::buildUrl('order/detail/'.$orderId)->suffix('')->domain(true)->build());
|
||||
CustomerService::sendOrderPaySuccessCustomerService($order, 1);
|
||||
WechatTemplateService::sendAdminNoticeTemplate([
|
||||
'first'=>"亲,您有一个新订单 \n订单号:{$order['order_id']}",
|
||||
'keyword1'=>'新订单',
|
||||
'keyword2'=>'已支付',
|
||||
'keyword3'=>date('Y/m/d H:i',time()),
|
||||
'remark'=>'请及时处理'
|
||||
]);
|
||||
}else if($routineOpenid){//小程序发送模板消息
|
||||
RoutineTemplate::sendOrderSuccess($formId, $orderId);
|
||||
CustomerService::sendOrderPaySuccessCustomerService($order, 0);
|
||||
}
|
||||
//向后台发送新订单消息
|
||||
ChannelService::instance()->send('NEW_ORDER', ['order_id'=>$orderId]);
|
||||
}catch (\Exception $e){}
|
||||
$user = User::where('uid', $order['uid'])->find()->toArray();
|
||||
//检测会员等级
|
||||
event('UserLevelAfter', [$user]);
|
||||
//支付成功后
|
||||
event('OrderPaySuccess', [$order]);
|
||||
//短信通知 下发用户支付成功 下发管理员支付通知
|
||||
event('ShortMssageSend',[$order['order_id'],['PaySuccess','AdminPaySuccess']]);
|
||||
event('OrderPaySuccess', [$order,$formId]);
|
||||
$res = $res1 && $resPink;
|
||||
return false !== $res;
|
||||
}
|
||||
@ -866,7 +839,7 @@ class StoreOrder extends BaseModel
|
||||
public static function orderTakeAfter($order)
|
||||
{
|
||||
$title=self::getProductTitle($order['cart_id']);
|
||||
if ($order['is_channel']) {//小程序
|
||||
if ($order['is_channel'] == 1) {//小程序
|
||||
RoutineTemplate::sendOut('OREDER_TAKEVER', $order['uid'], [
|
||||
'keyword1' => $order['order_id'],
|
||||
'keyword2' => $title,
|
||||
@ -932,6 +905,7 @@ class StoreOrder extends BaseModel
|
||||
return self::setErrorInfo($e->getMessage());
|
||||
}
|
||||
self::commitTrans();
|
||||
event('UserLevelAfter',[User::get($uni)]);
|
||||
event('UserOrderTake', $uni);
|
||||
//短信通知
|
||||
event('ShortMssageSend',[$order['order_id'],['Receiving','AdminConfirmTakeOver']]);
|
||||
@ -1076,7 +1050,7 @@ class StoreOrder extends BaseModel
|
||||
}
|
||||
}
|
||||
}
|
||||
$order['offlinePayStatus'] = (int)SystemConfigService::get('offline_pay_status') ?? (int)2;
|
||||
$order['offlinePayStatus'] = (int)sysConfig('offline_pay_status') ?? (int)2;
|
||||
return $order;
|
||||
}
|
||||
|
||||
@ -1384,7 +1358,7 @@ class StoreOrder extends BaseModel
|
||||
//订单已完成 数量
|
||||
$data['complete_count'] = self::statusByWhere(4, $uid)->where('is_del', 0)->where('uid', $uid)->count();
|
||||
//订单退款
|
||||
$data['refund_count'] = self::statusByWhere(-3, $uid)->where('is_del', 0)->where('uid', $uid)->count();
|
||||
$data['refund_count'] = self::statusByWhere(-1, $uid)->where('is_del', 0)->where('uid', $uid)->count();
|
||||
return $data;
|
||||
}
|
||||
|
||||
@ -1439,7 +1413,7 @@ class StoreOrder extends BaseModel
|
||||
* @return string|null
|
||||
* @throws \Psr\SimpleCache\InvalidArgumentException
|
||||
*/
|
||||
public static function orderUnpaidCancel($limit = 10, $prefid = 'order_unpaid_page', $expire = 3600)
|
||||
public static function orderUnpaidCancel()
|
||||
{
|
||||
//系统预设取消订单时间段
|
||||
$keyValue = ['order_cancel_time', 'order_activity_time', 'order_bargain_time', 'order_seckill_time', 'order_pink_time'];
|
||||
@ -1451,47 +1425,37 @@ class StoreOrder extends BaseModel
|
||||
//检查是否有未支付的订单 未支付查询条件
|
||||
$unPidCount = self::where('paid', 0)->where('pay_type', '<>', 'offline')->where('is_del', 0)->where('status', 0)->where('refund_status', 0)->count();
|
||||
if (!$unPidCount) return null;
|
||||
//总分页条数
|
||||
$pagesSum = ceil(bcdiv($unPidCount, $limit, 2));
|
||||
if (Cache::has($prefid)) {
|
||||
$pages = Cache::get($prefid);
|
||||
$pages++;
|
||||
Cache::set($prefid, $pages, $expire);
|
||||
} else {
|
||||
$pages = 1;
|
||||
Cache::set($prefid, $pages, $expire);
|
||||
}
|
||||
if ($pages > $pagesSum) Cache::set($prefid, 0, $expire);
|
||||
self::beginTrans();
|
||||
try {
|
||||
$res = true;
|
||||
// 未支付查询条件
|
||||
$orderList = self::where('paid', 0)->where('pay_type', '<>', 'offline')->where('is_del', 0)->where('status', 0)->where('refund_status', 0)->field('add_time,pink_id,order_id,seckill_id,bargain_id,combination_id,status,cart_id,use_integral,refund_status,uid,unique,back_integral,coupon_id,paid,is_del')->page($pages, $limit)->select();
|
||||
$orderList = self::where('paid', 0)->where('pay_type', '<>', 'offline')->where('is_del', 0)->where('status', 0)->where('refund_status', 0)->field('add_time,pink_id,order_id,seckill_id,bargain_id,combination_id,status,cart_id,use_integral,refund_status,uid,unique,back_integral,coupon_id,paid,is_del')->select();
|
||||
foreach ($orderList as $order) {
|
||||
if ($order['seckill_id']) {
|
||||
//优先使用单独配置的过期时间
|
||||
$order_seckill_time = $systemValue['order_seckill_time'] ? $systemValue['order_seckill_time'] : $systemValue['order_activity_time'];
|
||||
$res = $res && self::RegressionAll($order_seckill_time, $order);
|
||||
unset($order_seckill_time);
|
||||
} else if ($order['bargain_id']) {
|
||||
$order_bargain_time = $systemValue['order_bargain_time'] ? $systemValue['order_bargain_time'] : $systemValue['order_activity_time'];
|
||||
$res = $res && self::RegressionAll($order_bargain_time, $order);
|
||||
unset($order_bargain_time);
|
||||
} else if ($order['pink_id'] || $order['combination_id']) {
|
||||
$order_pink_time = $systemValue['order_pink_time'] ? $systemValue['order_pink_time'] : $systemValue['order_activity_time'];
|
||||
$res = $res && self::RegressionAll($order_pink_time, $order);
|
||||
unset($order_pink_time);
|
||||
} else {
|
||||
$res = $res && self::RegressionAll($systemValue['order_cancel_time'], $order);
|
||||
}
|
||||
}
|
||||
if ($res) self::commitTrans();
|
||||
if (!$res) throw new \Exception('更新错误');
|
||||
unset($orderList,$res,$pages);
|
||||
return null;
|
||||
} catch (PDOException $e) {
|
||||
self::rollbackTrans();
|
||||
Log::error('未支付自动取消时发生数据库查询错误,错误原因为:'.$e->getMessage());
|
||||
return $e->getMessage();
|
||||
throw new \Exception($e->getMessage());
|
||||
} catch (\think\Exception $e) {
|
||||
self::rollbackTrans();
|
||||
Log::error('未支付自动取消时发生系统错误,错误原因为:'.$e->getMessage());
|
||||
return $e->getMessage();
|
||||
throw new \Exception($e->getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
@ -1515,6 +1479,7 @@ class StoreOrder extends BaseModel
|
||||
$res3 = self::RegressionCoupon($order);
|
||||
$res = $res1 && $res2 && $res3;
|
||||
if ($res) $res = false !== self::where('order_id', $order['order_id'])->update(['is_del' => 1, 'mark' => '订单未支付已超过系统预设时间']);
|
||||
unset($res1,$res2,$res3);
|
||||
return $res;
|
||||
} else
|
||||
return true;
|
||||
@ -1599,43 +1564,40 @@ class StoreOrder extends BaseModel
|
||||
*/
|
||||
public static function startTakeOrder()
|
||||
{
|
||||
self::beginTrans();
|
||||
try{
|
||||
//7天前时间戳
|
||||
$systemDeliveryTime = SystemConfigService::get('system_delivery_time') ?? 0;
|
||||
//0为取消自动收货功能
|
||||
if($systemDeliveryTime == 0) return true;
|
||||
$sevenDay = strtotime(date('Y-m-d H:i:s',strtotime('-'. $systemDeliveryTime .' day')));
|
||||
$model = new self;
|
||||
$model = $model->alias('o');
|
||||
$model = $model->join('StoreOrderStatus s','s.oid=o.id');
|
||||
$model = $model->where('o.paid', 1);
|
||||
$model = $model->where('s.change_type', 'delivery_goods');
|
||||
$model = $model->where('s.change_time', '<',$sevenDay);
|
||||
$model = $model->where('o.status', 1);
|
||||
$model = $model->where('o.refund_status', 0);
|
||||
$model = $model->where('o.is_del', 0);
|
||||
$orderInfo = $model->column('id','id');
|
||||
if(!count($orderInfo)) return true;
|
||||
$res = true;
|
||||
foreach ($orderInfo as $key=>&$item){
|
||||
$order = self::get($item);
|
||||
if($order['status'] == 2) continue;
|
||||
if($order['paid'] == 1 && $order['status'] == 1) $data['status'] = 2;
|
||||
else if($order['pay_type'] == 'offline') $data['status'] = 2;
|
||||
else continue;
|
||||
if(!self::edit($data,$item,'id')) continue;
|
||||
try{
|
||||
OrderRepository::storeProductOrderTakeDeliveryAdmin($order, $item);
|
||||
$res = $res && true;
|
||||
}catch (\Exception $e){
|
||||
$res = $res && false;
|
||||
}
|
||||
$res = $res && StoreOrderStatus::status($item,'take_delivery','已收货[自动收货]');
|
||||
//7天前时间戳
|
||||
$systemDeliveryTime = sysConfig('system_delivery_time') ?? 0;
|
||||
//0为取消自动收货功能
|
||||
if($systemDeliveryTime == 0) return true;
|
||||
$sevenDay = strtotime(date('Y-m-d H:i:s',strtotime('-'. $systemDeliveryTime .' day')));
|
||||
$model = new self;
|
||||
$model = $model->alias('o');
|
||||
$model = $model->join('StoreOrderStatus s','s.oid=o.id');
|
||||
$model = $model->where('o.paid', 1);
|
||||
$model = $model->where('s.change_type', 'delivery_goods');
|
||||
$model = $model->where('s.change_time', '<',$sevenDay);
|
||||
$model = $model->where('o.status', 1);
|
||||
$model = $model->where('o.refund_status', 0);
|
||||
$model = $model->where('o.is_del', 0);
|
||||
$orderInfo = $model->column('id','id');
|
||||
if(!count($orderInfo)) return true;
|
||||
$res = true;
|
||||
foreach ($orderInfo as $key=>&$item){
|
||||
$order = self::get($item);
|
||||
if($order['status'] == 2) continue;
|
||||
if($order['paid'] == 1 && $order['status'] == 1) $data['status'] = 2;
|
||||
else if($order['pay_type'] == 'offline') $data['status'] = 2;
|
||||
else continue;
|
||||
if(!self::edit($data,$item,'id')) continue;
|
||||
try{
|
||||
OrderRepository::storeProductOrderTakeDeliveryAdmin($order, $item);
|
||||
$res = $res && true;
|
||||
}catch (\Exception $e){
|
||||
$res = $res && false;
|
||||
}
|
||||
self::checkTrans($res);
|
||||
}catch (\Exception $e){
|
||||
self::rollbackTrans();
|
||||
$res = $res && StoreOrderStatus::status($item,'take_delivery','已收货[自动收货]');
|
||||
}
|
||||
if(!$res){
|
||||
throw new \Exception('收货失败');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -70,7 +70,7 @@ class StorePink extends BaseModel
|
||||
$model = $model->alias('p');
|
||||
$model = $model->field('p.*,u.nickname,u.avatar');
|
||||
$model = $model->where('id',$id);
|
||||
$model = $model->join('__user__ u','u.uid = p.uid');
|
||||
$model = $model->join('user u','u.uid = p.uid');
|
||||
return $model->find();
|
||||
}
|
||||
|
||||
@ -85,7 +85,7 @@ class StorePink extends BaseModel
|
||||
$model = $model->field('p.*,u.nickname,u.avatar');
|
||||
$model = $model->where('k_id',$id);
|
||||
$model = $model->where('is_refund',0);
|
||||
$model = $model->join('__user__ u','u.uid = p.uid');
|
||||
$model = $model->join('user u','u.uid = p.uid');
|
||||
$model = $model->order('id asc');
|
||||
return $model->select();
|
||||
}
|
||||
@ -116,7 +116,7 @@ class StorePink extends BaseModel
|
||||
$model = $model->where('p.k_id',0);
|
||||
$model = $model->where('p.is_refund',0);
|
||||
$model = $model->order('p.add_time desc');
|
||||
$model = $model->join('__user__ u','u.uid = p.uid');
|
||||
$model = $model->join('user u','u.uid = p.uid');
|
||||
$list = $model->select();
|
||||
$list=count($list) ? $list->toArray() : [];
|
||||
if($isAll){
|
||||
@ -194,7 +194,7 @@ class StorePink extends BaseModel
|
||||
if($openid){ //公众号模板消息
|
||||
$firstWeChat = '亲,您的拼团已经完成了';
|
||||
$keyword1WeChat = self::where('id|k_id',$pid)->where('uid',$item)->value('order_id');
|
||||
$keyword2WeChat = self::alias('p')->where('p.id|p.k_id',$pid)->where('p.uid',$item)->join('__store_combination__ c','c.id=p.cid')->value('c.title');
|
||||
$keyword2WeChat = self::alias('p')->where('p.id|p.k_id',$pid)->where('p.uid',$item)->join('store_combination c','c.id=p.cid')->value('c.title');
|
||||
$remarkWeChat = '点击查看订单详情';
|
||||
$urlWeChat = Route::buildUrl('order/detail/'.$keyword1WeChat)->suffix('')->domain(true)->build();
|
||||
WechatTemplateService::sendTemplate($openid,WechatTemplateService::ORDER_USER_GROUPS_SUCCESS,[
|
||||
@ -223,7 +223,7 @@ class StorePink extends BaseModel
|
||||
* @param $pid
|
||||
*/
|
||||
public static function orderPinkAfterNo($uid,$pid,$formId='',$fillTilt='',$isRemove=false){
|
||||
$store = self::alias('p')->where('p.id|p.k_id',$pid)->field('c.*')->where('p.uid',$uid)->join('__store_combination__ c','c.id=p.cid')->find();
|
||||
$store = self::alias('p')->where('p.id|p.k_id',$pid)->field('c.*')->where('p.uid',$uid)->join('store_combination c','c.id=p.cid')->find();
|
||||
$pink = self::where('id|k_id',$pid)->where('uid',$uid)->find();
|
||||
$openid = WechatUser::uidToOpenid($uid, 'openid');
|
||||
$routineOpenid = WechatUser::uidToOpenid($uid, 'routine_openid');
|
||||
@ -451,7 +451,7 @@ class StorePink extends BaseModel
|
||||
$res = $res1 && $res2;
|
||||
}
|
||||
// 开团成功发送模板消息
|
||||
if($openid && !$order['is_channel']){ //公众号模板消息
|
||||
if($openid && $order['is_channel'] != 1){ //公众号模板消息
|
||||
$urlWeChat = Route::buildUrl('/order/detail/'.$pink['order_id'])->suffix('')->domain(true)->build();
|
||||
WechatTemplateService::sendTemplate($openid,WechatTemplateService::OPEN_PINK_SUCCESS,[
|
||||
'first'=> '您好,您已成功开团!赶紧与小伙伴们分享吧!!!',
|
||||
@ -460,7 +460,7 @@ class StorePink extends BaseModel
|
||||
'keyword3'=> $pink['people'],
|
||||
'remark'=> '点击查看订单详情'
|
||||
],$urlWeChat);
|
||||
}else if($routineOpenid && $order['is_channel']){
|
||||
}else if($routineOpenid && $order['is_channel'] == 1){
|
||||
RoutineTemplate::sendOut('OPEN_PINK_SUCCESS',$order['uid'],[
|
||||
'keyword1'=>date('Y-m-d H:i:s',$pink['add_time']),
|
||||
'keyword2'=>date('Y-m-d H:i:s',$pink['stop_time']),
|
||||
@ -494,7 +494,7 @@ class StorePink extends BaseModel
|
||||
// $pinkRakeBack = self::where('id',$id)->field('people,price,uid,id')->find()->toArray();
|
||||
// $countPrice = bcmul($pinkRakeBack['people'],$pinkRakeBack['price'],2);
|
||||
// if(bcsub((float)$countPrice,0,2) <= 0) return true;
|
||||
// $rakeBack = (SystemConfigService::get('rake_back_colonel') ?: 0)/100;
|
||||
// $rakeBack = (sysConfig('rake_back_colonel') ?: 0)/100;
|
||||
// if($rakeBack <= 0) return true;
|
||||
// $rakeBackPrice = bcmul($countPrice,$rakeBack,2);
|
||||
// if($rakeBackPrice <= 0) return true;
|
||||
@ -717,7 +717,7 @@ class StorePink extends BaseModel
|
||||
foreach ($pinkUidList as $key=>&$item){
|
||||
$openid = WechatUser::uidToOpenid($item, 'openid');
|
||||
$routineOpenid = WechatUser::uidToOpenid($item, 'routine_openid');
|
||||
$store = self::alias('p')->where('p.id|p.k_id',$pink)->field('c.*')->where('p.uid',$item)->join('__store_combination__ c','c.id=p.cid')->find();
|
||||
$store = self::alias('p')->where('p.id|p.k_id',$pink)->field('c.*')->where('p.uid',$item)->join('store_combination c','c.id=p.cid')->find();
|
||||
$pink = self::where('id|k_id',$pink)->where('uid',$item)->find();
|
||||
if($openid){
|
||||
//公众号模板消息
|
||||
@ -792,7 +792,7 @@ class StorePink extends BaseModel
|
||||
//公众号模板消息
|
||||
$firstWeChat = '亲,您的拼团已经完成了';
|
||||
$keyword1WeChat = self::where('id|k_id',$pink)->where('uid',$item)->value('order_id');
|
||||
$keyword2WeChat = self::alias('p')->where('p.id|p.k_id',$pink)->where('p.uid',$item)->join('__store_combination__ c','c.id=p.cid')->value('c.title');
|
||||
$keyword2WeChat = self::alias('p')->where('p.id|p.k_id',$pink)->where('p.uid',$item)->join('store_combination c','c.id=p.cid')->value('c.title');
|
||||
$remarkWeChat = '点击查看订单详情';
|
||||
$urlWeChat = Route::buildUrl('order/detail/'.$keyword1WeChat)->suffix('')->domain(true)->build();
|
||||
WechatTemplateService::sendTemplate($openid,WechatTemplateService::ORDER_USER_GROUPS_SUCCESS,[
|
||||
@ -839,6 +839,7 @@ class StorePink extends BaseModel
|
||||
$success = self::successPinkEdit($successPinkList);
|
||||
$error = self::failPinkEdit($failPinkList);
|
||||
$res = $success && $error;
|
||||
return $res;
|
||||
if(!$res)
|
||||
throw new \Exception('拼团订单取消失败!');
|
||||
}
|
||||
}
|
||||
@ -226,7 +226,7 @@ class StoreProduct extends BaseModel
|
||||
public static function setLevelPrice($list, $uid, $isSingle = false)
|
||||
{
|
||||
if (is_object($list)) $list = count($list) ? $list->toArray() : [];
|
||||
if (!SystemConfigService::get('vip_open')) {
|
||||
if (!sysConfig('vip_open')) {
|
||||
if (is_array($list)) return $list;
|
||||
return $isSingle ? $list : 0;
|
||||
}
|
||||
@ -299,6 +299,13 @@ class StoreProduct extends BaseModel
|
||||
: StoreProductAttr::uniqueByStock($uniqueId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 加销量减销量
|
||||
* @param $num
|
||||
* @param $productId
|
||||
* @param string $unique
|
||||
* @return bool
|
||||
*/
|
||||
public static function decProductStock($num, $productId, $unique = '')
|
||||
{
|
||||
if ($unique) {
|
||||
@ -309,7 +316,7 @@ class StoreProduct extends BaseModel
|
||||
}
|
||||
if($res){
|
||||
$stock = self::where('id', $productId)->value('stock');
|
||||
$replenishment_num = SystemConfigService::get('store_stock') ?? 0;//库存预警界限
|
||||
$replenishment_num = sysConfig('store_stock') ?? 0;//库存预警界限
|
||||
if($replenishment_num >= $stock){
|
||||
try{
|
||||
ChannelService::instance()->send('STORE_STOCK', ['id'=>$productId]);
|
||||
@ -319,13 +326,13 @@ class StoreProduct extends BaseModel
|
||||
return $res;
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* 减少销量,增加库存
|
||||
* @param int $num 增加库存数量
|
||||
* @param int $productId 产品id
|
||||
* @param string $unique 属性唯一值
|
||||
* @return boolean
|
||||
* */
|
||||
*/
|
||||
public static function incProductStock($num, $productId, $unique = '')
|
||||
{
|
||||
$product = self::where('id', $productId)->field(['sales', 'stock'])->find();
|
||||
@ -344,9 +351,15 @@ class StoreProduct extends BaseModel
|
||||
return $res;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取产品分销佣金最低和最高
|
||||
* @param $storeInfo
|
||||
* @param $productValue
|
||||
* @return int|string
|
||||
*/
|
||||
public static function getPacketPrice($storeInfo, $productValue)
|
||||
{
|
||||
$store_brokerage_ratio = SystemConfigService::get('store_brokerage_ratio');
|
||||
$store_brokerage_ratio = sysConfig('store_brokerage_ratio');
|
||||
$store_brokerage_ratio = bcdiv($store_brokerage_ratio, 100, 2);
|
||||
if (count($productValue)) {
|
||||
$Maxkey = self::getArrayMax($productValue, 'price');
|
||||
@ -385,9 +398,12 @@ class StoreProduct extends BaseModel
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* 获取二维数组中最大的值
|
||||
* */
|
||||
* @param $arr
|
||||
* @param $field
|
||||
* @return int|string
|
||||
*/
|
||||
public static function getArrayMax($arr, $field)
|
||||
{
|
||||
$temp = [];
|
||||
@ -401,9 +417,12 @@ class StoreProduct extends BaseModel
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* 获取二维数组中最小的值
|
||||
* */
|
||||
* @param $arr
|
||||
* @param $field
|
||||
* @return int|string
|
||||
*/
|
||||
public static function getArrayMin($arr, $field)
|
||||
{
|
||||
$temp = [];
|
||||
@ -426,6 +445,7 @@ class StoreProduct extends BaseModel
|
||||
{
|
||||
return self::whereIn('id', $productIds)->column('store_name,image', 'id');
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO 获取某个字段值
|
||||
* @param $id
|
||||
|
||||
@ -140,14 +140,14 @@ class StoreProductRelation extends BaseModel
|
||||
->alias('A')
|
||||
->where('A.type','collect')/*->where('A.category','product')*/
|
||||
->order('A.add_time DESC')
|
||||
->join('__store_product__ B','A.product_id = B.id')
|
||||
->join('store_product B','A.product_id = B.id')
|
||||
->page($page, $limit)
|
||||
->select();
|
||||
}else{
|
||||
$list = self::where('A.uid',$uid)
|
||||
->field('B.id pid,A.category,B.store_name,B.price,B.ot_price,B.sales,B.image,B.is_del,B.is_show')->alias('A')
|
||||
->where('A.type','collect')/*->where('A.category','product')*/
|
||||
->order('A.add_time DESC')->join('__store_product__ B','A.product_id = B.id')
|
||||
->order('A.add_time DESC')->join('store_product B','A.product_id = B.id')
|
||||
->select();
|
||||
}
|
||||
if(!$list) return [];
|
||||
|
||||
@ -40,11 +40,6 @@ class StoreProductReply extends BaseModel
|
||||
return time();
|
||||
}
|
||||
|
||||
protected function setPicsAttr($value)
|
||||
{
|
||||
return is_array($value) ? json_encode($value) : $value;
|
||||
}
|
||||
|
||||
protected function getPicsAttr($value)
|
||||
{
|
||||
return json_decode($value,true);
|
||||
@ -77,8 +72,8 @@ class StoreProductReply extends BaseModel
|
||||
{
|
||||
$model = self::productValidWhere($alias)->where('A.product_id',$productId)
|
||||
->field('A.product_score,A.service_score,A.comment,A.merchant_reply_content,A.merchant_reply_time,A.pics,A.add_time,B.nickname,B.avatar,C.cart_info,A.merchant_reply_content')
|
||||
->join('__user__ B','A.uid = B.uid')
|
||||
->join('__store_order_cart_info__ C','A.unique = C.unique');
|
||||
->join('user B','A.uid = B.uid')
|
||||
->join('store_order_cart_info C','A.unique = C.unique');
|
||||
switch ($type){
|
||||
case 1:
|
||||
$model=$model->where('A.product_score',5);//好评
|
||||
@ -97,7 +92,7 @@ class StoreProductReply extends BaseModel
|
||||
{
|
||||
$model = self::setProductReplyWhere($productId,$order);
|
||||
if($page) $model = $model->page((int)$page,(int)$limit);
|
||||
$list = $model->select()->toArray()?:[];
|
||||
$list = $model->order('add_time desc')->select()->toArray()?:[];
|
||||
foreach ($list as $k=>$reply){
|
||||
$list[$k] = self::tidyProductReply($reply);
|
||||
}
|
||||
@ -114,6 +109,7 @@ class StoreProductReply extends BaseModel
|
||||
$res['star'] = bcadd($res['product_score'],$res['service_score'],2);
|
||||
$res['star'] =bcdiv($res['star'],2,0);
|
||||
$res['comment'] = $res['comment'] ? :'此用户没有填写评价';
|
||||
$res['pics'] = is_string($res['pics']) ? json_decode($res['pics'],true) : $res['pics'];
|
||||
unset($res['cart_info']);
|
||||
return $res;
|
||||
}
|
||||
@ -127,8 +123,8 @@ class StoreProductReply extends BaseModel
|
||||
{
|
||||
$res = self::productValidWhere('A')->where('A.product_id',$productId)
|
||||
->field('A.product_score,A.service_score,A.comment,A.merchant_reply_content,A.merchant_reply_time,A.pics,A.add_time,B.nickname,B.avatar,C.cart_info')
|
||||
->join('__user__ B','A.uid = B.uid')
|
||||
->join('__store_order_cart_info__ C','A.unique = C.unique')
|
||||
->join('user B','A.uid = B.uid')
|
||||
->join('store_order_cart_info C','A.unique = C.unique')
|
||||
->order('A.add_time DESC,A.product_score DESC, A.service_score DESC, A.add_time DESC')->find();
|
||||
if(!$res) return null;
|
||||
return self::tidyProductReply($res->toArray());
|
||||
|
||||
@ -169,11 +169,11 @@ class StoreSeckill extends BaseModel
|
||||
* @return bool
|
||||
*/
|
||||
public static function incSeckillStock($num = 0,$seckillId = 0){
|
||||
$seckill=self::where('id',$seckillId)->field(['stock','sales'])->find();
|
||||
$seckill = self::where('id',$seckillId)->field(['stock','sales'])->find();
|
||||
if(!$seckill) return true;
|
||||
if($seckill->sales > 0) $seckill->sales=bcsub($seckill->sales,$num,0);
|
||||
if($seckill->sales < 0) $seckill->sales=0;
|
||||
$seckill->stock=bcadd($seckill->stock,$num,0);
|
||||
if($seckill->sales > 0) $seckill->sales = bcsub($seckill->sales,$num,0);
|
||||
if($seckill->sales < 0) $seckill->sales = 0;
|
||||
$seckill->stock = bcadd($seckill->stock,$num,0);
|
||||
return $seckill->save();
|
||||
}
|
||||
}
|
||||
@ -55,7 +55,6 @@ class Cache extends BaseModel
|
||||
*/
|
||||
public static function delectDeOverdueDbCache()
|
||||
{
|
||||
return self::where('add_time','<>',0)->where('add_time','<',time())->delete();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -108,7 +108,7 @@ class SystemUserLevel extends BaseModel
|
||||
if(!$leval_id && !$isArray) $leval_id = self::setWhere()->where('grade', self::setWhere()->min('grade'))->order('add_time DESC')->value('id');
|
||||
$list = self::setWhere()->field('name,discount,image,icon,explain,id,grade')->order('grade asc')->select();
|
||||
$list = count($list) ? $list->toArray() : [];
|
||||
foreach ($list as $item){
|
||||
foreach ($list as &$item){
|
||||
if($item['id'] == $leval_id)
|
||||
$grade = $item['grade'];
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user