Esempio n. 1
0
 public function run()
 {
     D("Purchase")->where("id=" . $this->mainrowId)->save(array("status" => 1));
     //财务
     if (isModuleEnabled("Finance")) {
     }
 }
Esempio n. 2
0
 public function run()
 {
     $this->updateStatus("Returns", $this->mainrowId, 2);
     //财务
     if (isModuleEnabled("Finance")) {
         $returns = D("Returns");
         $theReturns = $returns->find($this->mainrowId);
         $financeModel = D("FinancePayPlan");
         $data = array("source_model" => "Returns", "source_id" => $this->mainrowId, "subject" => $theReturns["subject"], "supplier_id" => $theReturns["customer_id"], "amount" => $theReturns["total_price_real"], "create_dateline" => CTS, "status" => 0, "type_id" => getTypeIdByAlias("pay", "returns"), "user_id" => getCurrentUid());
         $lastId = $financeModel->add($data);
         //            echo $lastId;exit;
         //            echo $financeModel->getLastSql();exit;
         import("@.Workflow.Workflow");
         $workflow = new Workflow("financePay");
         $node = $workflow->doNext($lastId, "", true);
         //            var_dump($node);
     }
 }
 public function appInstall($alias)
 {
     $installSql = sprintf("%s/apps/%s/data/sqls/install.sql", ROOT_PATH, $alias);
     if (is_file($installSql)) {
         $rs = importSQL($installSql);
         if (true !== $rs) {
             $this->error = $rs[0];
             return false;
         }
     }
     if ($this->workflows) {
         if (!isModuleEnabled("workflow")) {
             $this->requireApp("workflow");
             return false;
         }
         if (!$this->appInsertWorkflow($this->workflows)) {
             return false;
         }
     }
     if ($this->authNodes) {
         $nodeActions = array("read", "add", "edit", "delete");
         foreach ($this->authNodes as $k => $node) {
             if (substr($node, -1, 1) == "*") {
                 foreach ($nodeActions as $act) {
                     array_push($this->authNodes, str_replace("*", $act, $node));
                 }
                 unset($this->authNodes[$k]);
             }
         }
         $model = D("AuthRule");
         foreach ($this->authNodes as $node) {
             $model->add(array("name" => $node, "status" => 1, "category" => $alias));
         }
     }
     return true;
 }
Esempio n. 4
0
function isAppLoaded($appName, $version = "0", $compare = ">=")
{
    return isModuleEnabled($appName, $version, $compare);
}