增加出庫通知單統計事件

2022-04-05 23:26:53 字數 2049 閱讀 2080

use wms;

drop table if exists riv_outbound_notice_statistics;

-- 增加出庫通知單統計表

create table `riv_outbound_notice_statistics` (

`ons_id` int(10) not null auto_increment comment '主鍵id',

`begin_time` datetime not null comment '統計起始時間',

`end_time` datetime not null comment '統計結束時間',

`onh_total_qty` bigint(19) not null comment '出庫通知單總建立量',

`onh_shiped_qty` bigint(19) not null comment '出庫通知單已發貨量',

primary key (`ons_id`)

) engine=innodb default charset=utf8 comment='出庫通知單統計表';

drop procedure if exists pro_outbound_notice_statistics;

-- 增加出庫通知單統計函式

delimiter //

create procedure `pro_outbound_notice_statistics`()

begin

declare create_notice_num varchar(50);

declare ship_notice_num varchar(50);

declare curtime varchar(50);

declare pretime varchar(50);

declare curday varchar(50);

declare curhour varchar(50);

set curtime = concat(date_format(now(),'%y-%m-%d %h'),':00:00');

set pretime = date_sub(curtime, interval 1 hour);

select count(1) into create_notice_num from riv_outbound_notice_h onh where onh.create_time < curtime and onh.create_time >= pretime;

select count(1) into ship_notice_num from riv_outbound_notice_h onh where onh.onh_status = 90 and onh.onh_ship_datetime < curtime and onh.onh_ship_datetime >= pretime;

select pretime,curtime ,create_notice_num,ship_notice_num;

insert into riv_outbound_notice_statistics(`begin_time`, `end_time`,`onh_total_qty`, `onh_shiped_qty`) values(pretime, curtime, create_notice_num, ship_notice_num );

end//

delimiter ;

drop event if exists event_auto_outbound_notice_statistics;

set global event_scheduler='on';

-- 增加出庫通知單統計事件

create event `event_auto_outbound_notice_statistics`

on schedule every 1 hour starts '2017-11-10 00:00:00' ends '2018-01-01 00:00:00'

on completion not preserve

enable

docall pro_outbound_notice_statistics();

如何增加自定義的簡訊通知模版

首先 找到languages sc utf 8 admin mailtemplate.lang.php增加乙個 duanxin desc 給使用者 簡訊通知 然後找到 includes arrayfiles msgtemplate.arrayfile.php增加一句 duanxin array de...