示例#1
0
文件: function.php 项目: wxl2012/wx
 public function action_menu_save($id = 0)
 {
     $data = \Input::post();
     $account = \Model_WXAccount::find($id);
     $account->set($data);
     if ($account->save()) {
         $account->checkToken();
         $result = \handler\mp\Api::generate_coustom_menu($account->temp_token, $data['menu']);
         die(json_encode(array('status' => 'succ', 'msg' => '菜单保存成功', 'errcode' => 0, 'result' => $result->body)));
     } else {
         die(json_encode(array('status' => 'err', 'msg' => '菜单保存失败', 'errcode' => 10)));
     }
     \View::set_global($params);
     $this->template->content = \View::forge("ace/mp/coustom_menu/index");
 }
示例#2
0
文件: material.php 项目: wxl2012/wx
 /**
  * 同步素材
  */
 public function action_syn()
 {
     $id = \Input::get('account_id');
     $id = $id ? $id : \Session::get('WXAccount')->id;
     $account = \Model_WXAccount::find($id);
     $account->checkToken();
     $result = \handler\mp\Api::syn_material($account->temp_token);
     if ($result !== true) {
         die(json_encode($result));
     }
 }