<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                # 案例介紹 - 客戶信息維護 本案例基于框架代碼,開發并維護OA系統的客戶信息 案例代碼下載地址: 鏈接:https://pan.baidu.com/s/1NYUJdmrIJ5X6NzWXC4BHvw 提取碼:m63e ## 案例效果 ![](https://img.kancloud.cn/3c/de/3cdea7a9e41076086fe5bfdbbefc0788_1627x760.png) ![](https://img.kancloud.cn/08/bc/08bc8d08b3a1244d8af21a8c3d85baa8_1502x735.png) ## 開發過程 ### 1. 創建C層控制器方法 首先在 controller 文件夾內創建 customer文件目錄以及customer.php 文件 ![](https://img.kancloud.cn/34/5b/345b7d94a2d11da4974cbd00be4e4c01_1444x553.png) 同時在customer.php 編寫或集成C層基類方法,參考代碼如下: ~~~ <?php /** * 客戶控制層類 */ class controller_customer_customer_customer extends controller_base_action { public $provArr; function __construct() { $this->objName = "customer"; $this->objPath = "customer_customer"; parent::__construct (); } /** * 跳轉到客戶信息列表 */ function c_page() { $this->view ( 'list' ); } /** * * 選擇客戶 */ function c_selectCustomers() { $this->assign ( 'showButton', $_GET ['showButton'] ); $this->assign ( 'showcheckbox', $_GET ['showcheckbox'] ); $this->assign ( 'checkIds', $_GET ['checkIds'] ); $this->view ( 'select' ); } /** * 客戶可編輯表格測試 */ function c_editlist() { $this->view ( 'edit-list' ); } /** * 跳轉到新增頁面 */ function c_toAdd() { $this->showDatadicts ( array ('TypeOne' => 'KHLX' ) ); //客戶類型數據字典 $this->assign ( 'createName', $_SESSION ['USERNAME'] ); $this->assign ( 'createNameId', $_SESSION ['USER_ID'] ); $this->assign ( 'CreateDT', date("Y-m-d") ); $this->provArr = $this->service->province_d (); $this->softSelect ( $this->service->province_d (), 'Prov' ); $this->view ( 'add' ); } /** * 新增對象操作 */ function c_add($isAddInfo = false) { $customer = $_POST [$this->objName]; $codeDao = new model_common_codeRule (); $customer ['objectCode'] = $codeDao->customerCode ( "customer", $customer ['TypeOne'], $customer ['CountryId'], $customer ['CityId'] ); $id = $this->service->add_d ( $customer, $isAddInfo ); $customer ['id'] = $id; if ($id) { echo "<script>window.returnValue='" . util_jsonUtil::encode ( $customer ) . "';</script>"; msg ( '添加成功!' ); } //$this->listDataDict(); } /** * 跳轉編輯頁面 */ function c_init() { $id = $_GET ['id']; $rows = $this->service->get_d ( $id ); foreach ( $rows as $key => $val ) { $this->assign ( $key, $val ); } $this->showDatadicts ( array ('TypeOne' => 'KHLX' ), $rows ['TypeOne'] ); $this->softSelect ( $this->provArr, 'Prov', $rows ['Prov'] ); try { $isRelated = $this->service->isCustomerRelated ( $id ); } catch ( Exception $e ) { $isRelated = true; } $this->assign ( "isRelated", $isRelated ); $this->assign ( "UpdateDT", date("Y-m-d") ); $this->display ( 'edit' ); } } ?> ~~~ ### 2. 創建V層頁面 在view/template 文件夾內,創建customer文件目錄以及相關的頁面文件和js文件 ![](https://img.kancloud.cn/34/16/34165e50c78e272abe8f96122e13fd91_410x701.png)![](https://img.kancloud.cn/34/16/34165e50c78e272abe8f96122e13fd91_410x701.png) 注意: 1. 頁面文件路徑需要與C層文件路徑相同 2. 頁面文件規則為 類名-模板名,如新增頁面 customer-add.htm ### 3. 創建M層文件,完成基礎數據操作 在model內建立和C層文件通用的customer文件目錄,并創建兩個model需要的文件 1. customer.php //model基礎文件 2. customerSql.php //數據庫配置文件 ![](https://img.kancloud.cn/7c/9f/7c9feaf4fb67f1b08b66086d503d3cae_343x495.png) 參考代碼如下: ~~~ <?php /** * 客戶model層類 */ class model_customer_customer_customer extends model_base { function __construct() { $this->tbl_name = "customer"; $this->sql_map = "customer/customer/customerSql.php"; parent::__construct (); } /**** * 讀取省份信息方法 * **/ function province_d() { $provice = new model_system_procity_province (); $proviceShow = $provice->findAll (); return $proviceShow; } /** * 修改客戶信息 */ function edit_d($object) { try { $this->start_d (); $sconfig = new model_common_securityUtil ("customer"); $key=$sconfig->md5Row($object); $object['skey_']=$key; // util_messageUtil::sendMessageByObjCode("customerUpdate",$object); parent::edit_d($object,true); $this->commit_d (); return true; } catch ( Exception $e ) { $this->rollBack (); return false; } } } ?> ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看