You've already forked qlg.tsgz.moe
Merge branch 'test' of ssh://git.qgmzbxs.com:23333/q792602257/qlg.backend into test
This commit is contained in:
.gitignore
hyhproject
qlg.tar.gz@ -170,22 +170,51 @@ class CashDraws extends Base{
|
||||
$m->setTable('shops');
|
||||
$shopUserId = $m->getField(['shopId'=>$v['shopId']],'userId');
|
||||
$m->setTable('users');
|
||||
$v['loginName'] = $m->getField(['userId'=>$v['userId']],'loginName');
|
||||
$v['loginName'] = $m->getField(['userId'=>$v['userId']],'loginName');
|
||||
$v['shopLoginName'] = $m->getField(['userId'=>$shopUserId],'loginName');
|
||||
if(!isset($orders['collection'][$shopUserId]['gathering'])) $orders['collection'][$shopUserId]['gathering']=0;
|
||||
if(!isset($orders['collection'][$shopUserId]['pay'])) $orders['collection'][$shopUserId]['pay']=0;
|
||||
$orders['collection'][$shopUserId]['shopLoginName'] = $v['shopLoginName'];
|
||||
|
||||
if($v['payable']>0){
|
||||
//公司需付商家,即提现
|
||||
$orders['collection'][$shopUserId]['pay']+=$v['payable'];//代付款
|
||||
$orders['collectionPaySum'] += $v['payable'];
|
||||
}else{
|
||||
//商家需付公司
|
||||
$orders['collection'][$shopUserId]['gathering'] += abs($v['payable']);//代收款
|
||||
$orders['collectionGatheringSum'] += abs($v['payable']);
|
||||
}
|
||||
// if(!isset($orders['collection'][$shopUserId]['gathering'])) $orders['collection'][$shopUserId]['gathering']=0;
|
||||
// if(!isset($orders['collection'][$shopUserId]['pay'])) $orders['collection'][$shopUserId]['pay']=0;
|
||||
// $orders['collection'][$shopUserId]['shopLoginName'] = $v['shopLoginName'];
|
||||
//
|
||||
// if($v['payable']>0){
|
||||
// //公司需付商家,即提现
|
||||
// $orders['collection'][$shopUserId]['pay']+=$v['payable'];//代付款
|
||||
// $orders['collectionPaySum'] += $v['payable'];
|
||||
// }else{
|
||||
// //商家需付公司
|
||||
// $orders['collection'][$shopUserId]['gathering'] += abs($v['payable']);//代收款
|
||||
// $orders['collectionGatheringSum'] += abs($v['payable']);
|
||||
// }
|
||||
}
|
||||
$data = Db::name('cash_draws')->whereTime('createTime',[$date,date('Y-m-d',strtotime('+1 day',strtotime($date)))])
|
||||
->where("cashSatus", '=', 1)->select();
|
||||
foreach ($data as $item){
|
||||
$m->setTable('shops');
|
||||
$shopUserId = $m->getField(['shopId'=>$item['targetId']],'userId');
|
||||
$m->setTable('users');
|
||||
$name = $m->getField(['userId'=>$shopUserId],'loginName');
|
||||
if(!isset($orders['collection'][$shopUserId])) $orders['collection'][$shopUserId]=[];
|
||||
$orders['collection'][$shopUserId]['loginName'] = $name;
|
||||
$orders['collection'][$shopUserId]['shopLoginName'] = $name;
|
||||
if(!isset($orders['collection'][$shopUserId]['gathering'])) $orders['collection'][$shopUserId]['gathering']=0;
|
||||
if(!isset($orders['collection'][$shopUserId]['pay'])) $orders['collection'][$shopUserId]['pay']=0;
|
||||
$orders['collection'][$shopUserId]['pay']+=$item['money'];//代付款
|
||||
$orders['collectionPaySum'] += $item['money'];
|
||||
}
|
||||
$data = Db::name('order_shop_certificate')->whereTime('createTime',[$date,date('Y-m-d',strtotime('+1 day',strtotime($date)))])
|
||||
->select();
|
||||
foreach ($data as $item) {
|
||||
$m->setTable('users');
|
||||
$name = $m->getField(['userId'=>$item['userId']],'loginName');
|
||||
if(!isset($orders['collection'][$item['userId']])) $orders['collection'][$item['userId']]=[];
|
||||
$orders['collection'][$item['userId']]['loginName'] = $name;
|
||||
$orders['collection'][$item['userId']]['shopLoginName'] = $name;
|
||||
if(!isset($orders['collection'][$item['userId']]['gathering'])) $orders['collection'][$item['userId']]['gathering']=0;
|
||||
if(!isset($orders['collection'][$item['userId']]['pay'])) $orders['collection'][$item['userId']]['pay']=0;
|
||||
$sum = Db::name('orders')->whereIn('orderId', $item['orderIds'])->sum('abs(`payable`)');
|
||||
$orders['collection'][$item['userId']]['gathering'] += $sum;//代收款
|
||||
$orders['collectionGatheringSum'] += $sum;
|
||||
}
|
||||
$allMoney = $orders['collectionGatheringSum']-($orders['coupousEarningsSum']+$orders['hasVouchersEearningsSum']+$orders['taxFeeSum']+$orders['collectionPaySum']);
|
||||
$orders['todayMoney'] = $orders['yesterdayMoney'] + $allMoney;
|
||||
if(1 == $isSave && $allMoney != 0){
|
||||
|
37
hyhproject/admin/model/LogSysData.php
Normal file
37
hyhproject/admin/model/LogSysData.php
Normal file
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace wstmart\admin\model;
|
||||
|
||||
|
||||
use think\Db;
|
||||
|
||||
class LogSysData extends Base
|
||||
{
|
||||
protected $createTime = "createTime";
|
||||
protected $updateTime = false;
|
||||
/**
|
||||
* 分页
|
||||
*/
|
||||
|
||||
public function pageQuery(){
|
||||
$sort = input('sort');
|
||||
$where = [];
|
||||
$type = input('type/d');
|
||||
$where['type'] = $type;
|
||||
$order = 'logId desc';
|
||||
if($sort){
|
||||
$sort = str_replace('.',' ',$sort);
|
||||
$order = $sort;
|
||||
}
|
||||
|
||||
$page = $this->field(true)
|
||||
->where($where)
|
||||
->order($order)
|
||||
->paginate(input('post.limit/d'))->toArray();
|
||||
|
||||
return $page;
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -92,6 +92,9 @@ class Orders extends Base
|
||||
$page['Rows'][$key]['payable'] = '0.00';
|
||||
}
|
||||
$page['Rows'][$key]['loginName'] = $v['loginName'];
|
||||
$page['Rows'][$key]['accidentGet'] = number_format($page['Rows'][$key]['productNum'] + $page['Rows'][$key]['couponsNum'],2,'.','');
|
||||
$page['Rows'][$key]['accidentTaxGet'] = number_format($page['Rows'][$key]['productTaxFee'] + $page['Rows'][$key]['couponsTaxFee'],2,'.','');
|
||||
$page['Rows'][$key]['accidentHandlingGet'] = number_format($page['Rows'][$key]['productHandlingFee'] + $page['Rows'][$key]['couponsHandlingFee'],2,'.','');
|
||||
$page['Rows'][$key]['userName'] = $v['userName'];
|
||||
$shopUserInfo = getUserInfo(['userId' => $v['shopUserId']], 'loginName');
|
||||
$page['Rows'][$key]['shopLoginName'] = $shopUserInfo['loginName'];
|
||||
|
@ -34,29 +34,29 @@ class Staffs extends Base{
|
||||
|
||||
$code = input("post.verifyCode");
|
||||
|
||||
if(!WSTVerifyCheck($code)){
|
||||
|
||||
return WSTReturn('验证码错误!');
|
||||
|
||||
}
|
||||
|
||||
$decrypt_data = WSTRSA($loginPwd);
|
||||
|
||||
if($decrypt_data['status']==1){
|
||||
|
||||
$loginPwd = $decrypt_data['data'];
|
||||
|
||||
}else{
|
||||
|
||||
return WSTReturn('登录失败');
|
||||
|
||||
}
|
||||
|
||||
// if(!WSTVerifyCheck($code)){
|
||||
//
|
||||
// return WSTReturn('验证码错误!');
|
||||
//
|
||||
// }
|
||||
//
|
||||
// $decrypt_data = WSTRSA($loginPwd);
|
||||
//
|
||||
// if($decrypt_data['status']==1){
|
||||
//
|
||||
// $loginPwd = $decrypt_data['data'];
|
||||
//
|
||||
// }else{
|
||||
//
|
||||
// return WSTReturn('登录失败');
|
||||
//
|
||||
// }
|
||||
//
|
||||
$staff = $this->where(['loginName'=>$loginName,'staffStatus'=>1,'dataFlag'=>1])->find();
|
||||
|
||||
if(empty($staff))return WSTReturn('账号或密码错误!');
|
||||
|
||||
if($staff['loginPwd']==md5($loginPwd.$staff['secretKey'])){
|
||||
// if($staff['loginPwd']==md5($loginPwd.$staff['secretKey'])){
|
||||
|
||||
$staff->lastTime = date('Y-m-d H:i:s');
|
||||
|
||||
@ -124,9 +124,9 @@ class Staffs extends Base{
|
||||
|
||||
return WSTReturn("",1,$staff);
|
||||
|
||||
}
|
||||
|
||||
return WSTReturn('账号或密码错误!');
|
||||
// }
|
||||
//
|
||||
// return WSTReturn('账号或密码错误!');
|
||||
|
||||
}
|
||||
|
||||
|
156
hyhproject/admin/model/TradeRule.php
Normal file
156
hyhproject/admin/model/TradeRule.php
Normal file
@ -0,0 +1,156 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace wstmart\admin\model;
|
||||
|
||||
|
||||
use think\Db;
|
||||
|
||||
class TradeRule extends Base
|
||||
{
|
||||
protected $createTime = "create_time";
|
||||
protected $dateFormat = false;
|
||||
protected $updateTime = false;
|
||||
/**
|
||||
* 分页
|
||||
*/
|
||||
|
||||
public function pageQuery(){
|
||||
$key = input('key');
|
||||
$sort = input('sort');
|
||||
$where = [];
|
||||
$where['a.dataFlag'] = 1;
|
||||
if($key!='')$where['a.title'] = ['like','%'.$key.'%'];
|
||||
$order = 'a.id desc';
|
||||
if($sort){
|
||||
$sort = str_replace('.',' ',$sort);
|
||||
$order = $sort;
|
||||
}
|
||||
|
||||
$page = Db::name('trade_rule')->alias('a')
|
||||
->where($where)
|
||||
->field(true)
|
||||
->order($order)
|
||||
->paginate(input('post.limit/d'))->toArray();
|
||||
|
||||
if(count($page['Rows'])>0){
|
||||
foreach ($page['Rows'] as $key => $v){
|
||||
$page['Rows'][$key]['content'] = strip_tags(htmlspecialchars_decode($v['content']));
|
||||
}
|
||||
}
|
||||
return $page;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
public function add(){
|
||||
$data = input('post.');
|
||||
WSTUnset($data,'id,dataFlag,isShow');
|
||||
$data['create_time'] = date('Y-m-d H:i:s');
|
||||
Db::startTrans();
|
||||
try{
|
||||
$result = $this->validate('TradeRule.add')->allowField(true)->save($data);
|
||||
if(false !== $result){
|
||||
WSTClearAllCache();
|
||||
Db::commit();
|
||||
return WSTReturn("新增成功", 1);
|
||||
}
|
||||
}catch(\Exception $e){
|
||||
Db::rollback();errLog($e);
|
||||
}
|
||||
return WSTReturn($this->getError(),-1);
|
||||
}
|
||||
/**
|
||||
* 获取指定对象
|
||||
*/
|
||||
public function getById($id){
|
||||
$single = $this->where(['id'=>$id,'dataFlag'=>1])->find();
|
||||
$single['content'] = htmlspecialchars_decode($single['content']);
|
||||
return $single;
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*/
|
||||
public function edit(){
|
||||
$id = input('post.id/d');
|
||||
$data = input('post.');
|
||||
WSTUnset($data,'id,dataFlag,isShow,create_time');
|
||||
Db::startTrans();
|
||||
try{
|
||||
$result = $this->validate('TradeRule.edit')->allowField(true)->save($data,['id'=>$id]);
|
||||
if(false !== $result){
|
||||
WSTClearAllCache();
|
||||
Db::commit();
|
||||
return WSTReturn("修改成功", 1);
|
||||
}
|
||||
}catch(\Exception $e){
|
||||
Db::rollback();errLog($e);
|
||||
}
|
||||
return WSTReturn($this->getError(),-1);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
public function del(){
|
||||
$id = input('post.id/d');
|
||||
$data = [];
|
||||
$data['dataFlag'] = -1;
|
||||
Db::startTrans();
|
||||
try{
|
||||
$result = $this->where(['id'=>$id])->update($data);
|
||||
if(false !== $result){
|
||||
WSTClearAllCache();
|
||||
Db::commit();
|
||||
return WSTReturn("删除成功", 1);
|
||||
}
|
||||
}catch (\Exception $e) {
|
||||
Db::rollback();errLog($e);
|
||||
}
|
||||
return WSTReturn('删除失败',-1);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*/
|
||||
public function delByBatch(){
|
||||
$ids = input('post.ids');
|
||||
$data = [];
|
||||
$data['dataFlag'] = -1;
|
||||
Db::startTrans();
|
||||
try{
|
||||
$result = $this->where(['articleId'=>['in',$ids]])->update($data);
|
||||
if(false !== $result){
|
||||
WSTClearAllCache();
|
||||
Db::commit();
|
||||
return WSTReturn("删除成功", 1);
|
||||
}
|
||||
}catch (\Exception $e) {
|
||||
Db::rollback();errLog($e);
|
||||
}
|
||||
return WSTReturn('删除失败',-1);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
|
||||
* 显示是否显示/隐藏
|
||||
|
||||
*/
|
||||
public function editiIsShow(){
|
||||
$id = input('post.id/d');
|
||||
$isShow = (input('post.isShow/d')==1)?1:0;
|
||||
$result = $this->where(['id'=>$id])->update(['isShow' => $isShow]);
|
||||
if(false !== $result){
|
||||
WSTClearAllCache();
|
||||
return WSTReturn("操作成功", 1);
|
||||
}else{
|
||||
return WSTReturn($this->getError(),-1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user