| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- <?php
- defined('BASEPATH') OR exit('No direct script access allowed');
- //用友YS的执行
- class Yyys extends Lyapi_Controller{
- // 注意:登录接口不能受基础控制器的登录校验,可以覆盖构造方法或单独处理
- public function __construct() {
- // 这里不执行登录校验,只加载缓存驱动
- parent::__construct(); // 暂时注释,或者使用一个新的不校验的基类
- $this->load->_model("Model_ysrecords","ysrecords");
- }
- public function lyysmsghz() {
- $ip = $this->input->ip_address();
- $json_str = $this->input->raw_input_stream;
- $data = json_decode($json_str,true);
- $jiami_str = hash_hmac('sha256', 'LYERP_'.$data['timestamp'], 'ys&ly202608261549');
- //$jiami_str.="&";
- // if($gsmc != $jiami_str){
- // echo "ERROR!-".$jiami_str;
- // }
- $ys_no = "";
- if(!empty($data['content'])){
- if(!empty($data['content']['code'])){
- $ys_no = $data['content']['code'];
- }
- }
- if($jiami_str != $data['gsmc']){
- $this->db->insert("ysnorecords",[
- 'ys_no'=>$ys_no,
- 'recept_cont'=>$json_str,
- 'addtime'=>time(),
- ]);
- echo "ERROR";
- exit;
- }else{
- $time = time();
- $info = $this->ysrecords->find("ys_no = '{$ys_no}'");
- if(empty($info)){
- $this->db->insert("ysnorecords",[
- 'ys_no'=>$ys_no,
- 'recept_cont'=>$json_str,
- 'addtime'=>time(),
- ]);
- echo "ERROR";
- exit;
- }
- //调拨订单审核
- if($data['type'] == 'st_transferapply_bill_audit'){
- $this->ysrecords->save(
- [
- 'recept_cont'=>$json_str,
- 'recepttime'=>$time,
- 'status'=>0,
- 'dotime'=>0
- ],$info['id']);
-
- }
- //调拨订单弃审
- if($data['st_transferapply_bill_unaudit']){
- $this->ysrecords->save(
- [
- 'recept_cont'=>$json_str,
- 'unaudit_time'=>$time,
- 'status'=>0,
- 'dotime'=>0
- ],$info['id']);
- }
- echo "SUCCESS";
- exit;
- }
-
-
-
- }
- }
|